检查RSpec示例而不运行它们

时间:2014-10-23 20:20:24

标签: rspec continuous-integration

我的spec_helper有标准:

RSpec.configure do |config|
  config.filter_run focus: true
  config.run_all_when_everything_filtered = true
end

这对我正在做的事情很有帮助,但如果我不小心提交了一个专注的规范,我希望我的CI版本失败。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

以下是建议Myron provided。它一直很适合我。

RSpec.configure do |config|
  if ENV['CI']
    config.before(:example, :focus) { raise "Should not commit focused specs" }
  else
    config.filter_run focus: true
    config.run_all_when_everything_filtered = true
  end
end
相关问题