[rspec-users] RSpec 2 autotest file

David Chelimsky dchelimsky at gmail.com
Sat Aug 7 19:00:23 EDT 2010


On Aug 7, 2010, at 4:54 PM, Ashley Moran wrote:

> Hi
> 
> I've tried using the autotest file from RSpec 2 (lib/autotest/rspec2.rb) but I've found a problem with it, that I think is a bug.
> 
> The file contains two sections
> 
> * an Autotest `Autotest.add_hook :initialize` block
> * an Autotest class "Autotest::Rspec2"
> 
> In one project I'm working on, the code in Autotest::Rspec2 is really useful to me, but the :initialize hook contains setup that interferes with my project structure (I don't want a "lib" folder.
> 
> Unfortunately, it appears that Autotest's `clear_mappings` can't stop the :initialize mappings making it into the final setup.  This means that to use Autotest::Rspec2, I've had to copy-paste the contents into my own autotest file, rather than subclassing.
> 
> Is this a bug?

Yes.

>  (ie, is there no workaround for the coupling between the two blocks?)  If so, can it be fixed?

Yes: http://github.com/rspec/rspec-core/commit/c2e8a3947321e501b84113c1b2b1049df4868f4b

> Alternatively (or as well), is it time to drop autotest and use watchr instead?  I noticed RSpec 2 uses that, and it seems really fast and simple, both of which go down very well with me...

I don't think we need to drop one to use the other :)

Cheers,
David

> Any thoughts?
> 
> Cheers
> Ash
> 
> -- 
> http://www.patchspace.co.uk/
> http://www.linkedin.com/in/ashleymoran
> 
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users



More information about the rspec-users mailing list