开发者

RSpec --tag exclude not working

I have examples 开发者_运维技巧like this in my spec file:

it "does something", :separate=> true do 
end

for tests I want to run separately from others. These two command lines,

rspec --tag separate spec/models
rspec --tag @separate spec/models

both work to run only the tagged examples. However, I can't seem to exclude those examples. None of these work:

rspec --tag ~@separate spec/models
rspec --tag -@separate spec/models
rspec --tag ~separate spec/models
rspec --tag -separate spec/models

With the tilde "~" the tag is ignored entirely and all the examples are run. With the hyphen "-", rspec looks for a tag value of "-separate" or "-@separate" and generates a notice like

Run filtered using {:"-separate"=>true}
No examples were matched. 

(The documentation uses the hyphen while the output of rspec --help uses the tilde for negation.)

What am I doing wrong?

(RSpec-core 2.5.1, RSpec-rails 2.5.0, Ubuntu 10.04 32-bit running in VirtualBox)


It looks like the tilde is the correct way to exclude tags, but it was bugged or not fully implemented in 2.5. Compare 2.6rc to 2.5.

Try upgrading to the pre-release 2.6

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜