[rspec-devel] [ rspec-Bugs-11337 ] autotest runs specs redundantly

noreply at rubyforge.org noreply at rubyforge.org
Mon Jun 4 00:27:31 EDT 2007


Bugs item #11337, was opened at 2007-06-03 20:38
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11337&group_id=797

Category: None
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 3
Submitted By: Erik Ostrom (eostrom)
>Assigned to: David Chelimsky (dchelimsky)
Summary: autotest runs specs redundantly

Initial Comment:
I'm running autotest 3.6.0 with rspec 2064 on Ruby 1.8.6 and Rails 1.2.3 on Windows XP SP2.

When I have a spec with two failing examples, autotest/rspec tries to rerun the spec twice.  For example, the command line might look like this:

    ruby script/spec -O spec/spec.opts  spec/models/comment_spec.rb; ruby script/spec -O spec/spec.opts spec/models/comment_spec.rb

BTW, this doesn't work on Windows, even after hacking autotest/rspec.rb to honor autotest's new command separator constant, but I think it's an autotest bug (http://rubyforge.org/tracker/index.php?func=detail&aid=11335&group_id=419&atid=1678).  The point of THIS bug is, it's running the same spec twice.  Or more, if there are more failing examples.

I was able to fix this to my satisfaction by changing this line in make_test_cmd in autotest/rspec.rb:

    return cmds.join('; ')

to

    return cmds.uniq.join('; ')

It might be better to compress the set of files before generating the commands, but I don't know the right place to do that.


----------------------------------------------------------------------

>Comment By: David Chelimsky (dchelimsky)
Date: 2007-06-04 04:27

Message:
Actually it turns out that there is a MUCH easier approach. Fixed in r2076.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11337&group_id=797


More information about the rspec-devel mailing list