upgrading to 1.4.2 from 1.4.1 breaks my rspec stub/unstub #201

Closed
agibralter opened this Issue Dec 5, 2012 · 14 comments

10 participants

@agibralter

Even though I have tried both

RSpec.configure do |config|
  config.mock_framework = :rspec
end

and

RSpec.configure do |config|
  config.mock_with :rspec
end

when I run my specs that use a combination of stubbing and unstubbing, I find that they use RSpec's stub method and Mocha's unstub method. This only seems to have popped up since I upgraded should-matchers to 1.4.2, which now includes mocha.

@recurser

+1, specs using unstub no longer pass under 1.4.2

@andreychernih

+1 having the same issues with unstub

@dnagir

Same issue here too.

@edlebert

+1, this was a nasty bug to track down.

@edlebert

To see for yourself:
1. Create a blank rails app.
2. Add rspec to the Gemfile, run bundle install.
3. Copy rspec's own spec for unstub into your rails app's spec folder.
4. Run rspec, watch it pass.
5. Add shoulda-matchers to your Gemfile, run bundle install.
6. Run rspec, watch it fail.

@edlebert

1.4.2 adds bourne as a gem dependency, so I'm guessing the problem is with bourne. I'll look into it.

@mkaschenko

Look at issue #202, I think, it's related.

@ryansch

This is certainly related to #202. I've downgraded to 1.4.1 for now.

@oneamtu

++

@prusswan

+++!!!

@mxie
thoughtbot, inc. member

I just tried reproducing this error by following @edlebert's steps, but I still don't see any failures...

What versions of rspec were people using when encountering this issue? And could someone try updating to version 2.0, which removes the dependency on bourne?

@agibralter

@mxie Yup, 2.0 seems to work now that bourne and mocha are not being loaded. As for @edlebert's suggestion, @mxie, did you specify shoulda-matchers 1.4.2? That's when it was broken for us.

@agibralter agibralter closed this Apr 5, 2013
@mxie
thoughtbot, inc. member

@agibralter It actually worked with 1.4.2 and 2.0 for me, but it's possible that I may have missed a step somewhere. In any case, I'm glad that 2.0 fixes it! Thanks for checking!

@oneamtu

awesome thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment