if defined?(ActiveRecord::Relation)
  RSpec::Matchers::BuiltIn::OperatorMatcher.register(ActiveRecord::Relation, '=~', RSpec::Matchers::BuiltIn::ContainExactly)
end

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

Add a check to support both RSpec 3 & 4
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.
