且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何告诉 rspec 在没有挂起测试输出的情况下运行?

更新时间:2022-11-30 13:59:15

看一看 标签 -

你可以在你的测试文件中做这样的事情

You could do something like this in your test file

describe "the test I'm skipping for now" do     
  it "slow example", :skip => true do
    #test here
  end
end

然后像这样运行你的测试:

and run your tests like this:

bundle exec rspec spec/models --format documentation --tag ~skip

其中 ~ 字符排除带有以下标记的所有测试,在本例中为 skip

where the ~ character excludes all tests with the following tag, in this case skip