We have a biggish rails app with a bunch of ‘legacy’ Test::Unit tests,
but we’re moving over to rspec for all our new work.
We’re going to be carrying these legacy tests around for a good while
though, so they need to play together nicely.
Before I installed the rspec plugins, autotest would run the Test::Unit
tests in the project if I just called the autotest command from the root
of the rails app.
Now, when I do the same thing, it just runs the specs… and that’s it -
the old Test::Unit tests are ignored. I’ve attached the output FYI.
I’d really like autotest to watch / run both rspec and Test::Unit tests
in case my changes break either type of test. Obviously I can still use
rake to run both, but I’d like to know I’ll get the instant feedback.
Plus I’m just intrigued about what’s going on! I’ve tried looking at the
AutoTest code in the vendor/plugins/rspec* directories but I’m a bit too
new to ruby (second week as a pro!) to figure out what’s going on in
there.
of the rails app.
new to ruby (second week as a pro!) to figure out what’s going on in
there.
The latest rspec code in git introduces an autospec command that runs
specs, leaving autotest to run the stuff in the test directory. This
doesn’t solve your problem, but might be useful information.
To run both tests and specs you’ll have to add a .autotest file and
modify the mappings between subject files and the tests and examples
that drive them. Check out http://blog.davidchelimsky.net/2008/1/15/rspec-1-1-2-and-zentest-3-8-0
and the ZenTest documentation for pointers on this.
The latest rspec code in git introduces an autospec command that runs
specs, leaving autotest to run the stuff in the test directory. This
doesn’t solve your problem, but might be useful information.
To run both tests and specs you’ll have to add a .autotest file and
modify the mappings between subject files and the tests and examples
that drive them. Check out http://blog.davidchelimsky.net/2008/1/15/rspec-1-1-2-and-zentest-3-8-0
and the ZenTest documentation for pointers on this.
Thanks David, that looks like plenty to go on. I can run autotest and
autospec in two different terminals for the time being I guess, and when
I gather the gumption I’ll blaze into the ~/.autotest stuff.
cheers,
Matt
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.