我有一个自定义脚本,如果很少有失败的例子,我可以重试失败的例子。bundle exec rspec [...]use 0 exit code to check whether specs all passed in one go or not.
failures_count=$(grep -o "failed" rspec_persistence.txtif [ "$failures_count" -e
我正在尝试做一个非常简单的请求规范,以便在我的应用程序中测试我的API方法。现在,我得到302条消息,而我应该得到200与这个测试。require 'spec_helper'
describe "#create" do post '/users', user: FactoryGirl.attributes_for(:user)
expect(response.status)
end 有没有办法使用Rspec让第二个测试依赖于第一个测试?我问这个问题的原因是因为我使用的是Watchr,而第二个测试需要更多的时间。如果第一个测试失败,第二个测试很可能也会失败。它们并不是真的相互依赖,但如果第一个测试失败,那么运行第二个测试是一种浪费时间。
我可以跳过在Watchr中使用Ctrl C的测试,但我想知道是否有更好的方法。在谷歌上什么都没找到。