Autotest quits when code has errors

Sorry, I’d put this in a ZenTest forum (as opposed to RSpec), except
that I can’t find one.

I find it frustrating that autotest keeps running when it finds failing
tests - but it quits back to the command line whenever a test or code
contains errors.

This means I have to constantly (like every 5 minutes) restart autotest
by hand, which kind of defeats the purpose of autotest, and I find it
hard to believe this is the default behavior.

If I want to do TDD/BDD and call methods before they exist, this causes
autotest to quit, which REALLY defeats the purpose.

Am I doing something wrong, or is there a fix? I’m using ZenTest 3.10
with RSpec 1.1.5.

Thanks!

On Mon, Jul 28, 2008 at 3:10 PM, Evan D. [email protected] wrote:

If I want to do TDD/BDD and call methods before they exist, this causes
autotest to quit, which REALLY defeats the purpose.

Am I doing something wrong, or is there a fix? I’m using ZenTest 3.10
with RSpec 1.1.5.

It sounds like it might be an RSpec 1.1.5 thing. I’ve used 1.1.4 with
autotest without seeing the problem you describe.

///ark

Try rspactor. I have been using since the author pinged this list
several months ago. No complaints thus far. To your point, it
doesn’t bomb when there is an error.

Anthony Broad-Crawford

On Mon, Jul 28, 2008 at 4:58 PM, Anthony Broad-Crawford <
[email protected]> wrote:

Try rspactor. I have been using since the author pinged this list several
months ago. No complaints thus far. To your point, it doesn’t bomb when
there is an error.

I use rspactor these days, too. A couple of things should be noted,
however:

  1. It’s Mac-only.

  2. It makes debugging rather painful if you run the debugger during
    rspactor’s execution. I think this might be because it’s polling for the
    Enter key instead of being signalled by ^C (autotest works the other way
    around!). This has the effect of swallowing some keystrokes while you’re
    in
    the debugger, which can be very irritating. The solution of course is
    either
    to 1) debug directly from script/spec, or 2) don’t use the debugger. :slight_smile:

///ark

On Mon, Jul 28, 2008 at 5:10 PM, Evan D. [email protected] wrote:

Sorry, I’d put this in a ZenTest forum (as opposed to RSpec), except
that I can’t find one.

I find it frustrating that autotest keeps running when it finds failing
tests - but it quits back to the command line whenever a test or code
contains errors.

What do you mean “it quits back to the command line”?

This means I have to constantly (like every 5 minutes) restart autotest
by hand, which kind of defeats the purpose of autotest, and I find it
hard to believe this is the default behavior.

If I want to do TDD/BDD and call methods before they exist, this causes
autotest to quit, which REALLY defeats the purpose.

That would suck, but I haven’t had this experience.

Am I doing something wrong, or is there a fix? I’m using ZenTest 3.10
with RSpec 1.1.5.

There has not been a 1.1.5 release, so I’m guessing you’re using code
from github, right?

Can you provide a bit more about what you’re doing? Are you using
Rails? If so, which version? If not, how are you organizing things?
Are you using a gem that you built?

Cheers,
David

Mark W. wrote:

It sounds like it might be an RSpec 1.1.5 thing. I’ve used 1.1.4 with
autotest without seeing the problem you describe.

I get a similar-ish thing: autotest doesn’t actually quit, but I get no
growl notification when there’s a ‘compile’ error, so it seems like
autotest doesn’t treat this as a ‘fail’ per se.

I find this slightly annoying, but I’m getting used to just hitting
Shift-CTRL-V in TextMate to validate my ruby as I save it.

Hope that info helps someone.

Matt

Mark W. wrote:

On Mon, Jul 28, 2008 at 3:10 PM, Evan D. [email protected] wrote:

It sounds like it might be an RSpec 1.1.5 thing. I’ve used 1.1.4 with
autotest without seeing the problem you describe.

I have the same problem on projects that use Test::Unit, too, at least
for some kinds of errors, particularly syntax errors.

I’ll check out this rspactor thing, I haven’t heard of it before. But
I’d still like to fix the original problem.

David C. wrote:

What do you mean “it quits back to the command line”?

Autotest stops running and I get a command prompt again.

There has not been a 1.1.5 release, so I’m guessing you’re using code
from github, right?

Yes, I’m using a version from github, in a Rails 2.1 project. rspec and
rspec-rails are installed in vendor/plugins. (as I understand it,
from this
post
, rspec > 1.1.4 is necessary for Rails 2.1)

One of the projects in question is in fact a fork of Insoshi, the
project referenced in that blog post I linked, so the copies of rspec
I’m using is the same version as in their git repo. The other is a
personal project, but the plugins are checked out the same way (from
github).

I don’t get this problem in another project I have, which is a R2.1
project as well but which uses Test::Unit instead of rspec. However, I
have seen a similar problem (autotest quitting when errors are
encountered) in that project in a similar version.

I think the next thing I’ll try is changing or erasing my .autotest
file. There’s very little in there - just some hooks for growl - but
it’s always possible that’s what’s different between my setup and that
of other folks.