开发者

Using rspec tags with autotest

I have a section of my test suite which runs a bunch of really slow importers. These tests don't need to be run often (unless the importers are actually being worked on) so I've split them out using Rspec tags: http://relishapp.com/rspec/rspe开发者_开发知识库c-core/v/2-4/dir/command-line/tag-option

This works great but what would be even more awesome would be if I could setup Autotest ignore the specs tagged this way be default. I can't seem to find an obvious way to do this. Does anyone know how to do this?


You can use the --tag option in the RSpec configuration file with a tilde to indicate specs to bypass. Autotest will execute RSpec using the values in the config file, and will pass along the --tag option as well.

Look for a file in your project root named .rspec.

Add something like --tag ~speed:slow

Add the tags to the slow specs:

it "should not run this really slow test", :speed => 'slow' do
  # blah blah
end

More examples can be found in the RSpec docs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜