[rspec-users] Gem conflict with RSpec::Rails and Sunspot

Shane Mingins elc at mingins.com
Sun Jul 18 20:32:57 EDT 2010

Hi All

I was wondering if someone could perhaps point me to where in RSpec::Rails
is the Rails ActionController being subclassed by an Object instance?  My
ruby-fu is not high enough to work out what's really going on with
RSpec::Rails with this.

The problem I am having (and I have a code example in the github link below
if you want to see, just clone and run rake spec) is that Sunspot is adding
an after filter to already loaded subclasses of ActionController::Base.

loaded_controllers =
            [base].concat(base.subclasses.map { |subclass|
subclass.constantize })

But that map is returning:

["ActionView::TestCase::TestController", "ApplicationController",

So I am trying to find what #<Class:0x1022e1168> is and where it's
subclassing ActionController.

If I comment out config.gem "rspec-rails" in the environment.rb the problem
goes away, but that is not a solution as I have boiled this issue down to
what I have here from a project that is actually using bundler and so these
gems are being specified and required.

As I do not know what in RSpec::Rails is actually causing the issue I cannot
raise this as an issue with Sunspot with an example of possibly what they
should be excluding in their code, if that is the solution to move to.

So if anyone could help me out in any way??  I'm happy to do more "leg work"
if you could give me some pointers.


git repo showing issue:

using ruby 1.8.7
ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100719/b318fbdc/attachment.html>

More information about the rspec-users mailing list