Skip to content

Commit

Permalink
Merge pull request #2425 from rspec/remove-monkey-patching
Browse files Browse the repository at this point in the history
Add a check to support both RSpec 3 & 4
  • Loading branch information
JonRowe committed Dec 26, 2020
1 parent b6dbe51 commit e9cee86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rspec/rails/matchers/relation_match_array.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
if defined?(ActiveRecord::Relation)
if defined?(ActiveRecord::Relation) && defined?(RSpec::Matchers::BuiltIn::OperatorMatcher) # RSpec 4 removed OperatorMatcher
RSpec::Matchers::BuiltIn::OperatorMatcher.register(ActiveRecord::Relation, '=~', RSpec::Matchers::BuiltIn::ContainExactly)
end

0 comments on commit e9cee86

Please sign in to comment.