[rspec-users] autotest?

Kero van Gelder kero at chello.nl
Thu May 21 02:46:37 EDT 2009


> Is there some configuration I need to do to get rid of unit/functional  
> tests and only run rspec+cucumber?

This eplains all there is to explain (though terse and not from
your use case)
   http://zentest.rubyforge.org/ZenTest/Autotest.html

and you now have to add code from that to your .autotest

If you want to clear existing mappings, and add new mappings,
while also ignoring any temp file created by cucumber (or autotest
will keep triggering because it saw an updated file; which
surprises me, as there is no mapping for those files...)
you get something like this:

Autotest.add_hook(:initialize) {|at|
  at.add_exception %r{^\.git}
  at.add_exception %r{^./tmp}
  at.clear_mappings  # take out the default (test/test*rb)
  at.add_mapping(%r{^lib/.*\.rb$}) {|filename, _|
    Dir['spec/**/*.rb']
  }
  nil
}

The nil make sure that other :initialize hooks get executed.
Very relevant if you have both ~/.autotest and .autotest

I guess I should add this in some form to the rspec wiki ;)

Bye,
Kero.

___
How can I change the world if I can't even change myself?
  -- Faithless, Salva Mea


More information about the rspec-users mailing list