We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
should
1 parent 6e6a597 commit 088bd0aCopy full SHA for 088bd0a
lib/rspec/rails/extensions/active_record/proxy.rb
@@ -1,7 +1,10 @@
1
RSpec.configure do |rspec|
2
# Delay this in order to give users a chance to configure `expect_with`...
3
rspec.before(:suite) do
4
- if defined?(RSpec::Matchers) && RSpec::Matchers.configuration.syntax.include?(:should) && defined?(ActiveRecord::Associations)
+ if defined?(RSpec::Matchers) &&
5
+ RSpec::Matchers.configuration.respond_to?(:syntax) && # RSpec 4 dropped support for monkey-patching `should` syntax
6
+ RSpec::Matchers.configuration.syntax.include?(:should) &&
7
+ defined?(ActiveRecord::Associations)
8
RSpec::Matchers.configuration.add_should_and_should_not_to ActiveRecord::Associations::CollectionProxy
9
end
10
0 commit comments