【问题标题】:How to suppress displaying pending (skipped) specs in RSpec?如何禁止在 RSpec 中显示挂起(跳过)的规范?
【发布时间】:2015-07-06 12:36:16
【问题描述】:

我有几个跳过的规格。

Pending: (Failures listed here are expected and do not affect your suite's status)

1) ...
   # Not yet implemented
   # ./spec/requests/request_spec.rb:22

如何抑制未决规范的输出?

【问题讨论】:

  • 令人惊讶的是,rspec --tag ~skip 起作用了。
  • 这个被标记为重复的问题实际上没有任何答案可以抑制这个问题中描述的“待定测试”部分。 (而且,据我所知,--tag ~skip 也没有。)

标签: ruby rspec


【解决方案1】:

您可以通过将测试标头中的“it”替换为“xit”来做到这一点。

it "returns true" do
    1.should == 1
end

替换为:

xit "returns true" do
    1.should == 1
end

在它之前添加 x 将跳过此测试。

【讨论】:

  • RSpec 跳过规范但将其报告为待处理规范。
猜你喜欢
  • 1970-01-01
  • 2016-01-22
  • 1970-01-01
  • 2013-05-21
  • 1970-01-01
  • 1970-01-01
  • 2020-06-30
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多