Ah of course, you're right. It needs to be in a begin rescue block at least. 

Sent from my iPhone

On Oct 20, 2013, at 11:54 AM, "Daniel Doubrovkine (dB.)" <notifications@github.com> wrote:

> In lib/tasks/rspec.rake:
> 
> >    FileUtils.rm_f RSpec::Rerun::Formatters::FailuresFormatter::FILENAME
> >  
> >    begin
> >      Rake::Task["rspec-rerun:run"].execute
> >    rescue
> > -    failed_count = File.read(RSpec::Rerun::Formatters::FailuresFormatter::FILENAME).split(/\n+/).count
> > -    puts "[#{Time.now}] Failed, rerunning #{failed_count} failure(s) ..."
> > -
> > -    Rake::Task["rspec-rerun:rerun"].execute
> > +    while retry_count > 0  
> > +      failed_count = File.read(RSpec::Rerun::Formatters::FailuresFormatter::FILENAME).split(/\n+/).count
> > +      puts "[#{Time.now}] Failed, rerunning #{failed_count} failure(s) ..."
> > +      retry_count -= 1
> > +      Rake::Task["rspec-rerun:rerun"].execute
> If the retry fails again, the second time around this will raise an exception which won't be caught. I have a fix and a spec, fyi.
> 
> —
> Reply to this email directly or view it on GitHub.