Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mocha + rpec-mocks #6

Open
BrazhnykYuriy opened this issue Aug 8, 2019 · 2 comments
Open

mocha + rpec-mocks #6

BrazhnykYuriy opened this issue Aug 8, 2019 · 2 comments

Comments

@BrazhnykYuriy
Copy link

BrazhnykYuriy commented Aug 8, 2019

Unfortunately i can't get this both to work together
rspec (3.8.0)
rspec-mocks (3.8.1)
mocha (1.4.0)

This is the line that is failing:

expect(User).to have_received(:activate!).once

(class)> expected to have received activate!, but that object is not a spy or method has not been stubbed.

I guess this is because RSpec expectations are looking for RSpec mocks instead of Mocha.|
Any ideas?

@raulcoan
Copy link

@BrazhnykYuriy I had the same issue, have you tried adding this to your config file? config.include Mocha::API
Also, the order that you include :mocha and :rspec at the config file appears to matter as well.

@BrazhnykYuriy
Copy link
Author

BrazhnykYuriy commented Dec 23, 2020

That was a long time ago, we successfully dropped mocha.
We used a flag on specs that defined what mocking library to use for each spec(included mocha or rspec-mocks before each spec).
And gradually rewritten all specs to rspec-mocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants