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
Fix Mocha compatibility #2256
Fix Mocha compatibility #2256
Conversation
@ZeroPointEnergy highly appreciate if you test this fix out with |
Thanks for the patch. Do you think we can test it in rspec-rails? Waiting for @ZeroPointEnergy feedback. |
I'm open to ideas how to do that. |
@pirj is it possible that the PR is not on the 4.x development branch? It threw some dependency errors when I tried to use the branch directly. However I simply cherry-picked ac886dc on top of v4.0.0.beta3 and can confirm that the patch indeed fixes the issue in puppet-dashboard! 👍 Thanks a lot for your work. |
Honestly I'm ok with just adding a comment on top explaining why the minimalist approach is taken. To add a test you'd have to assert a bunch of stuff about poisoning the environment which is a fair amount of effort to setup... |
RSpec Mocks happened to load its configuration, use the default syntax and define `any_instance` on `Class` before Mocha had a chance to in case `rspec/rails` was required in `spec/spec_helper.rb`. fixes #2252
11d8c22
to
38efe12
Compare
Looks green. |
Rushed it a bit. @benoittgt do you have any objections on merging as is? I can do a follow-up in that case. |
No no it's perfect! Thanks a lot 😊 |
Released as |
RSpec Mocks happened to load its configuration, use the default syntax and define
any_instance
onClass
before Mocha had a chance to in caserspec/rails
was required inspec/spec_helper.rb
beforerspec/core
and configuring Mocha asmock_with
.This is not something typical, as usually
rails_helper.rb
requiresrspec-rails
, andspec_helper.rb
requiresrspec-core
and configuresmock_with
, but not something that is a complete no-no.fixes #2252