spec/mongoid/matchable_spec.rb in mongoid-7.0.13 vs spec/mongoid/matchable_spec.rb in mongoid-7.1.0.rc0
- old
+ new
@@ -1,5 +1,8 @@
+# frozen_string_literal: true
+# encoding: utf-8
+
require "spec_helper"
describe Mongoid::Matchable do
describe "#_matches?" do
@@ -291,21 +294,21 @@
end
context 'when a BSON::Regexp::Raw object is used' do
let(:selector) do
- { street: BSON::Regexp::Raw.new("\\AClarkenwell") }
+ { street: BSON::Regexp::Raw.new("^Clarkenwell") }
end
it "returns true" do
expect(document._matches?(selector)).to be true
end
end
context 'when a native Regexp object is used' do
let(:selector) do
- { street: /\AClarkenwell/ }
+ { street: /^Clarkenwell/ }
end
it "returns true" do
expect(document._matches?(selector)).to be true
end