简体   繁体   English

在Travis上,如何修改测试以使用minitest代替rspec?

[英]On Travis how do I modify tests to use minitest instead of rspec?

The link for ask question on Travis dot com sent me here. Travis dot com上的询问链接将我发送到这里。 My tests fail because I'm using minitest in my gem but travis uses rspec. 我的测试失败了,因为我在gem中使用了minitest,但是travis使用了rspec。 Is there a way to get travis to do that also? 是否有办法让travis也这样做? Of course I can always modify my tests to use rspec but I'm not sure how to get tests or spec from my structure of my tests. 当然,我总是可以修改测试以使用rspec,但是我不确定如何从测试结构中获取测试或规范。 They all have assert_equal which is not recognized by respec as a valid method. 它们都具有assert_equal,respec无法将其识别为有效方法。 Is there a common way to make either test work with the same *_spec.rb files? 是否有一种通用方法可以使两个测试都可以使用相同的* _spec.rb文件?

I found in the docs that it is possible to define custom commands for running tests (rather than the default bundle exec rake test ) by placing these lines in .travis.yml 我在文档中发现,可以通过将这些行放在.travis.yml来定义用于运行测试的自定义命令(而不是默认的bundle exec rake test

script:
- bundle exec rake build
- bundle exec rake builddoc

This is another option to run your test in your .travis.yml: 这是在.travis.yml中运行测试的另一种选择:

script:
    - bin/rails test

Remeber to install the gems before run the scripts. 运行脚本之前,请记住先安装gem。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM