有没有办法在describe和它的块中输出字符串而不运行实际规范。我们正在考虑将我们的任务列表迁移到这些字符串
describe "second group task001" do
it "second example in second group" do
#some really long task that shouldn't be run
FactoryGirl.create(:really_long_factory)
end
end
输出:
rspec this_spec.rb -fd
second group task001
second example in second group
THX
答案 0 :(得分:0)
替代方法xit
会做你想要的。 https://www.relishapp.com/rspec/rspec-core/v/2-3/docs/pending/pending-examples涵盖了处理这类“未决”示例的各种备选方案。
答案 1 :(得分:0)
答案 2 :(得分:0)
使用pending
:
irb(main):012:0> describe "second group task001" do
irb(main):013:1* pending "second example in second group" do
irb(main):014:2* #some really long task that shouldn't be run
irb(main):015:2* end
irb(main):016:1> end
=> RSpec::Core::ExampleGroup::Nested_2