Hi everyone,

If you are like me, you have a bunch of auto-generated R-Spec files from
Rails' script/generate calls or other plugins' generator methods. And on
newer projects, I don't have alot of time to go through and make sure EVERY
single generated spec passes (and I'm not commenting them all out!).
Sometimes the only tests I really care about at the moment are the ones I
need to write. Autotest is great and all, but if you have failing specs, it
is going to re-run them each time they fail (which could be alot!). Here is
a little hook that will only run the last updated file or related spec for
the task at hand, so you can go through them one by one:

Place this in RAILS_ROOT/.autotest
=====================
Autotest.add_hook :updated do |autotest, updated|
    autotest.files_to_test.clear
end
=====================

Now you can concentrate on GREEN-ing that one spec you need to write,
without having to see all the RED garbage from those other specs. Once your
file passes, all specs get run again, as usual!

Now, it would be nice to have this as a switch-able mode, like:

script/autospec --single

but I can't seem to get ARGV to play nice with autotest...

Hope this is helpful!

Regards,
Adam
--
Adam Grant
Lead Web Engineer
Telaeris, Inc.
[email protected]
(858) 627-9710

--~--~---------~--~----~------------~-------~--~----~
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
-~----------~----~----~----~------~----~------~--~---

Reply via email to