[rspec-users] [Rails] Stubbed static methods are bleeding over into other specs and making them fail

David Chelimsky dchelimsky at gmail.com
Sat Jul 10 15:54:12 EDT 2010


On Jul 9, 2010, at 7:37 PM, Patrick Gannon wrote:

> 
> On Mon, Jul 5, 2010 at 1:26 PM, David Chelimsky <dchelimsky at gmail.com> wrote:
> I just pushed what I  believe to be a fix for this - please try pointing Gemfile to the git repos again. It should work if you do this with all of them:
> 
> gem "rspec-rails",        :git => "git://github.com/rspec/rspec-rails.git"
> gem "rspec",              :git => "git://github.com/rspec/rspec.git"
> gem "rspec-core",         :git => "git://github.com/rspec/rspec-core.git"
> gem "rspec-expectations", :git => "git://github.com/rspec/rspec-expectations.git"
> gem "rspec-mocks",        :git => "git://github.com/rspec/rspec-mocks.git"
> 
> Let me know if it works out.
> 
> 
> Hi David,
> 
> I just got a chance to try this, and ran into more problems.  Prior to trying this, we were running RSpec2 beta 13.  When I changed our Gemfile to depend on 'edge' RSpec et al (as you suggested above), I get a very strange error when I run rake (after doing a 'bundle install').  The same error occurs after I tell it specifically to use beta 16 (rather than 'edge').  It seems to somehow not be able to find the bundler gem when it runs the main bundler script from within rake:
> 
> C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem bundler (>= 0) (Gem::LoadError)
>         from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:214:in `activate'
>         from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems.rb:1082:in `gem'
>         from C:/Ruby187/bin/bundle:18
> rake aborted!
> bundle exec  C:/Ruby187/bin/ruby.exe  -Ilib -Ispec "./spec/controllers/discrepancies_controller_spec.rb" (...spec names omitted..) failed
> 
> When I downgrade back to beta 13, everything works again.  I can't seem to figure out why it wouldn't be able to find the bundler gem (since obviously bundler is installed), so I cannot say whether or not your fix for the stubbing issue solved my problem.  The stack trace (resulting from running rake with "--trace") and my current list of installed gems (via "bundle list") is here: http://gist.github.com/470278 (sorry for the line breaks)

bundler-1.0.0.beta.4 should fix this. Please give it a shot.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100710/4d4ebd1e/attachment.html>


More information about the rspec-users mailing list