Skip to content

Commit 60a1c26

Browse files
committed
Add a check to support both RSpec 3 & 4
RSpec 4 has removed OperatorMatcher, as it was only supported by the should syntax, and not expect syntax.
1 parent 088bd0a commit 60a1c26

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
if defined?(ActiveRecord::Relation)
2+
&& defined?(RSpec::Matchers::BuiltIn::OperatorMatcher) # RSpec 4 removed OperatorMatcher
23
RSpec::Matchers::BuiltIn::OperatorMatcher.register(ActiveRecord::Relation, '=~', RSpec::Matchers::BuiltIn::ContainExactly)
34
end

0 commit comments

Comments
 (0)