RSpec Autotest for Standalone Projects
Posted by Nick Sieger Tue, 30 Jan 2007 02:16:00 GMT
I know there has been some demand out there for a version of my RSpec Autotest Rails plugin that works with standalone (non-Rails) projects, so I finally caved and coded it up. I really hope this does finally get accepted as a patch to ZenTest (nudge, nudge), but until it gets a more standard release, do try it out:
- Ensure you have ZenTest installed (
gem install ZenTest). - Download the rspec_autotest.rb file here and put it in the
specdirectory of your project. - Add this snippet of code into your
Rakefile, andrake spec:autotestas usual.
namespace :spec do
task :autotest do
require './spec/rspec_autotest'
RspecAutotest.run
end
endOnce again, happy spec’ing, and let me know of any issues you have with it.
Love it! Thanks, Nick.
One feature request: It would be nice to have a task to run it against the spec server which is much faster.
Something like:
namespace :spec do task :autotest do require_rspec_autotest RspecOnRailsAutotest.run end task :autotest_drb do require_rspec_autotest autotest = RspecOnRailsAutotest.new autotest.spec_command = "drbspec --diff unified" autotest.run end private def require_rspec_autotest require File.join(File.dirname(__FILE__), '..', 'lib', 'rspec_autotest') end end