7

My impression of how autotest is intended to work (based on the cucumber github wiki, and other stuff online) is that it should rerun red examples until they pass. My problem is that it reruns all examples in the spec file where a failing example is found, including passing ones. I'd rather not waste time rerunning passing examples while fixing a failing one. Can autotest be configured so only the failing examples are run?

fakeleft
  • 2,830
  • 2
  • 30
  • 32
  • Have you since (a) upgraded RSpec, (b) upgraded Rails, and (c) installed gem `guard-rspec` instead? Autotest is not used as much with the newer RSpec versions, to my understanding. – onebree Apr 14 '15 at 20:40
  • Yeah, running things manually seems to work well enough for my purposes. I should mention that guard strikes me as an obsolete suggestion... I've switched off it to zeus a while back, and use spring now that I've gone through the rails 4 upgrade. Ahh, the joys of keeping up... – fakeleft Apr 15 '15 at 09:53
  • guard-rspec is not really obsolete. Spork and its guard plugin is, however. Are you still using autotest? – onebree Apr 15 '15 at 13:06

1 Answers1

0

You need the rspec-retry gem. Here are some examples from the docs on how to implement it:

Apply it in a configure block covering your entire test-suite...

RSpec.configure do |config|
    config.verbose_retry = true # show retry status in spec process
    config.default_retry_count = 3
end

Or apply it unit-by-unit...

it 'should randomly succeed', :retry => 3 do
    expect(rand(2)).to eq(1)
end
digitalextremist
  • 5,952
  • 3
  • 43
  • 62