[rspec-devel] Rails #8115 and spec/matchers/have

Zach Dennis zach.dennis at gmail.com
Fri Nov 9 22:17:50 EST 2007


Rspec now breaks with Rails because of require path issues. Attached is a
patch to fix those.

It's because rspec_on_rails comes first in the $LOAD_PATH and both rspec and
rspec_on_rails now have a "extensions.rb" file so "require
'spec/extensions'" is loading the wrong one first.


-- 
Zach Dennis
http://www.continuousthinking.com

On 11/8/07, David Chelimsky <dchelimsky at gmail.com> wrote:
>
> On Nov 8, 2007 11:29 AM, David Chelimsky <dchelimsky at gmail.com> wrote:
> > On Nov 8, 2007 9:20 AM, Brandon Keepers <brandon at collectiveidea.com>
> wrote:
> > > Rails commit #8115 refactored how plugins are loaded and now adds all
> > > the vendor/plugins/*/lib directories to the load path before
> > > initializing all the plugins.
> > >
> > > rspec and rspec_on_rails both have spec/matchers/have.rb, and now that
> > > they're both in the load path, when rspec initializes and requires
> > > spec/matchers/have, the rspec_on_rails version gets loaded.
> > >
> > > This seems to only happen when I run integration tests and not specs
> > > (stack trace below).  The ways I see to fix this are 1) require these
> > > using an absolute path or 2) rename the rails one to spec/rails/
> > > matchers/have, or something along those lines.
> > >
> > > I'd be happy to submit a patch, let me know what you think about ways
> > > to get around this.
> >
> > A patch would be awesome - thanks!
> >
> > How about moving it from rspec_on_rails/lib/spec/matchers/have to
> > rspec_on_rails/lib/extensions/spec/matchers/have and include require
> > 'spec/matchers/have' from within that file.
> >
> > That file monkey patches Spec::Matchers::Have and I think putting
> > under an extensions directory makes sense.
> >
> > WDYT?
>
> Actually - I'll take care of this - should have it committed in a few.
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>



-- 
Zach Dennis
http://www.continuousthinking.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20071109/c217ab64/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rspec_require.diff
Type: application/octet-stream
Size: 1334 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/rspec-devel/attachments/20071109/c217ab64/attachment.obj 


More information about the rspec-devel mailing list