2014-10-20 54 views
2

当我运行RSpec的与--tag选项运行不同的测试比用相同--tag选项

spring rspec --tag ~slow 

无我的测试运行rspec的春天,我看到这个意外的输出:

Run options: 
    include {:focus=>true} 
    exclude {:slow=>true} 

All examples were filtered out; ignoring {:focus=>true} 

All examples were filtered out 

Finished in 0.21728 seconds (files took 0.43359 seconds to load) 
0 examples, 0 failures 

当我运行:

rspec --tag ~slow 

我看到下面的组预期的测试运行:

Run options: 
    include {:focus=>true} 
    exclude {:slow=>true} 

All examples were filtered out; ignoring {:focus=>true} 

. 
. testing output remove for berevity 
. 


Finished in 6.9 seconds (files took 15.29 seconds to load) 
179 examples, 0 failures, 4 pending 

这是一个问题,我可以修复或者,如果我想使用弹簧,我必须放弃使用--tags?

TL; DR:似乎我必须选择使用Spring的节省时间,还是节省跳过rspec慢速测试的时间。无法同时获得。

附录: 春季提交的问题在这里:https://github.com/rails/spring/issues/359

回答

0

这现在工作:

time spring rspec ./spec --tag speed:slow 
    time spring rspec ./spec --tag ~speed:slow 

好像加入 “./spec” 是必要的变化。

使用:
*弹簧(1.2.0)
*弹簧命令-rspec的(1.0.2)
* rspec的-collection_matchers(1.0.0)
* rspec的核(3.0.4)
* rspec的期许(3.0.4)
* rspec的,嘲笑(3.0.4)
* RSpec的护栏(3.0.2)
* RSpec的支持(3.0.4)

相关问题