2014-10-20 57 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)

相關問題