2013-06-22 32 views
3

我使用spring寶石來加速我的rspeccucumber測試。
我在我的兩個spec/spec_helper.rbfeatures/support/env.rb文件以下配置:使用SimpleCov製作Spring寶石

require 'simplecov' 
SimpleCov.start 'rails' 

如果我開始我的測試與rspec spec/rake cucumber:ok,比SimpleCov合併報告,我得到了我想要的。
但是,如果我使用spring rspec spec/spring cucumber features/,則每個命令將覆蓋先前的報告並且不合並它們。
如何使spring合併報告?

回答

6

您需要爲每個報告提供一個名稱,以便Simplecov知道它們將被合併。 Simplecov試圖發現命令,但彈簧命令使它不可能,所以手動。

所以在spec/spec_helper.rb

SimpleCov.command_name "RSpec" 

而且在features/support/env.rb

SimpleCov.command_name "Cucumber" 

記住這樣的更改生效停止春季服務器:

spring stop 

More info

+0

謝謝,它工作。 – konnigun