-
-
Notifications
You must be signed in to change notification settings - Fork 912
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
shoulda-matchers not working with spring #486
Comments
I have this same issue. There is a workaround by requiring shoulda-matchers a little later. So in your gem 'shoulda-matchers', require: false ...and then in require 'shoulda-matchers' Since Rails 4.1 ships with Spring by default, it would be nice to note this in the README. |
Thanks for the report. Yeah, shoulda-matchers needs to be loaded after RSpec is loaded, so that it can detect it and inject itself into the appropriate example groups. This should automatically happen when Bundler requires your gems, because Why has this always worked before, then? Because the Why doesn't this now work? Because Spring flips it around: spec_helper (and your Gemfile) are loaded before the /cf #382 |
Closing in favor of #490. |
The instructions on how to install shoulda-matchers in your project have changed: for best results, now you must manually require it in your spec_helper (which has actually become rails_helper in RSpec 3.x). For more information: <thoughtbot/shoulda-matchers#486 (comment)>
Not sure if this is a spring issue or a shoulda-matchers issue.
On Rails 4.1, spring 1.1.2 and shoulda-matchers 2.6.0 none of the matchers from shoulda-matchers seem to work:
Here is an example app with spring setup https://github.com/Soliah/foo
Running
bundle exec rspec spec
works fine, but using the spring binstub for rspecbin/rspec
causes theundefined method
error.The text was updated successfully, but these errors were encountered: