#202 √ invalid
Coda Hale

autotest doesn't register specs which have syntax errors or exceptions as failing

Reported by Coda Hale | December 21st, 2007 @ 03:16 AM

I use RSpec and autotest, and my process for adding a new class generally goes like this:

1. create a spec file in the right place, require spec_helper from that

2. make sure that passes

3. require the non-existent file from the spec

4. make sure that fails

5. create a blank file in the lib directory

6. make sure that passes

7. add a usage of the class name from the spec

8. make sure that fails

9. add a class definition

10. make sure that passes

The problem with this is that autotest doesn't register specs which quit due to an unhandled exception as failing, nor does the resolution of these errors generate a green notification.

The attached patch modifies the autotest code to treat a spec process which outputs nothing as failing run and calls the red hook.

Comments and changes to this ticket

  • Coda Hale

    Coda Hale February 7th, 2008 @ 06:43 AM

    A fix which works against ZenTest 3.9.1 is as follows:

      def handle_results(results)
        failed = results.scan(self.failed_results_re)
        completed = results =~ self.completed_re && !results.empty?
    
        self.files_to_test = consolidate_failures failed if completed
    
        color = completed && self.files_to_test.empty? && !results.empty? ? :green : :red
        hook color unless $TESTING
    
        self.tainted = true unless self.files_to_test.empty?
      end
    
  • David Chelimsky

    David Chelimsky February 8th, 2008 @ 03:20 AM

    • → State changed from “new” to “open”
    • → Assigned user changed from “” to “David Chelimsky”

    I think this one should go against ZenTest instead of RSpec. WDYT?

  • Coda Hale

    Coda Hale February 8th, 2008 @ 03:14 AM

    Well, when I opened this ticket the offending code was in RSpec rather than ZenTest. I agree, though -- I'll go bug Ryan about this.

  • David Chelimsky

    David Chelimsky February 8th, 2008 @ 03:38 AM

    • → State changed from “open” to “invalid”

    Ah - got it. Just noticed the ticket today because you updated it today.

    Anyhow, the last couple of ZenTest releases have required less and less from RSpec, so we've been able to get rid or more and more code.

  • Ryan Davis

    Ryan Davis April 23rd, 2008 @ 09:33 AM

    Coda, can you file a proper patch against autotest please?

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Behaviour Driven Development for Ruby.

Shared Ticket Bins

People watching this ticket