spec/mongoid/matchable/or_spec.rb in mongoid-6.1.0 vs spec/mongoid/matchable/or_spec.rb in mongoid-6.1.1
- old
+ new
@@ -8,18 +8,18 @@
let(:matcher) do
described_class.new("value", person)
end
- describe "#matches?" do
+ describe "#_matches?" do
context "when provided a simple expression" do
context "when any of the values are equal" do
let(:matches) do
- matcher.matches?(
+ matcher._matches?(
[ { title: "Sir" }, { title: "King" } ]
)
end
before do
@@ -32,18 +32,18 @@
end
context "when none of the values are equal" do
it "returns false" do
- expect(matcher.matches?([])).to be false
+ expect(matcher._matches?([])).to be false
end
end
context "when the expression is a $not" do
let(:matches) do
- matcher.matches?([ { title: {:$not => /Foobar/ } }])
+ matcher._matches?([ { title: {:$not => /Foobar/ } }])
end
context "when the value matches" do
it "returns true" do
@@ -67,11 +67,11 @@
context "when provided a complex expression" do
context "when any of the values are equal" do
let(:matches) do
- matcher.matches?(
+ matcher._matches?(
[
{ title: { "$in" => [ "Sir", "Madam" ] } },
{ title: "King" }
]
)
@@ -87,11 +87,11 @@
end
context "when none of the values are equal" do
let(:matches) do
- matcher.matches?(
+ matcher._matches?(
[
{ title: { "$in" => [ "Prince", "Madam" ] } },
{ title: "King" }
]
)
@@ -107,10 +107,10 @@
end
context "when expression contain multiple fields" do
let(:matches) do
- matcher.matches?(
+ matcher._matches?(
[
{ title: "Sir", age: 23 },
{ title: "King", age: 100 }
]
)