-
-
Notifications
You must be signed in to change notification settings - Fork 909
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
Problems when running specs with Zeus #384
Comments
This is a bit of a known issue, see #333.
|
Aha, removing Thanks @mcmire. |
this broke when I upgraded from shoulda_matchers 2.5 to 2.6.0 / 2.6.1 |
Same problem for me as well when I upgrade 1.5.4 to 2.6.0 / 2.6.1. |
This is also broken for me - No autorun in my spec helper, and the gem is pulled in after rails-rspec. |
same here |
I'll reopen this and take another look when I get a chance. |
I had the same problem with Zeus, without require 'rspec/rails'
require 'shoulda/matchers' This didn't fix the problem and I still got What did fix the problem was following the README to the point and changing group :test do
gem 'shoulda-matchers'
end in my Gemfile to this too: group :test do
gem 'shoulda-matchers', require: false
end So, in the end following the fix described in the README step by step solved the issue for me. |
probably an unrelated issue, but following these directions has broken |
@michaelglass Please file a new issue for this and let me know what error you're getting. Thanks. |
I'm going ahead and closing this issue due to inactivity. I'm fairly confident we've nailed this as I haven't seen any more reports from people around this, but I would suggest upgrading to 2.6.2 and seeing if that solves the problem. |
same issue on 3.0.0 alpha, rolling back to 2.8.0 solves issue |
That's because shoulda-matchers no longer installs itself into your test framework automatically. You'll need to add this to your rails_helper: Shoulda::Matchers.configure do |config|
config.integrate do |with|
with.test_framework :rspec
with.library :rails
end
end |
Still getting this when running with zeus: NoMethodError: undefined method `belong_to' for #RSpec::ExampleGroups::Business::AssociationSpecs:0x007fba5722d580 I added require: false as suggested, it didn't help |
@SergeyBukhman Are you experiencing this on 2.8.0 or 3.0.0.alpha? |
2.8.0 |
(using rails 4.2.1 and shoulda-matchers 2.8.0) To get it to work, I added a support file with the following:
|
Works now. Added |
Zeus does the same thing that Spring does: it preloads your gems (as well as your Rails env). You need to prevent shoulda-matchers from preloading b/c otherwise it gets preloaded before RSpec does, so it doesn't automatically mix itself into your example groups. That's why there's a two-step process in the README. You shouldn't have to |
group :test do
gem 'shoulda-matchers', require: false
end The above works for me. Funnily enough it has been working for other developers. |
Adding |
version 2.8.0 solved my problem. |
1 similar comment
version 2.8.0 solved my problem. |
It is working for me
|
Make sure you have |
👍 Add Moving the gems around didn't, same with the requires. Thanks! |
@cunknown suggestion of |
I'm on Rails 4.1.6 and shoulda-matchers 3.1.1 and I had to do the new configuration as described in the official documentation and the |
I'm using
[zeus]
(https://github.com/burke/zeus) to pre-load the code, for when I'm running specs. It appears that zeus isn't properly requiringshoulda-matchers
library for some reason.I see errors like this:
The text was updated successfully, but these errors were encountered: