mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Use spy to test that matchers use === operator
This commit is contained in:
parent
e42e5b30bb
commit
71427e4f6b
2 changed files with 18 additions and 0 deletions
|
@ -2,6 +2,15 @@ require "../spec_helper"
|
|||
|
||||
describe Spectator::Matchers::AttributesMatcher do
|
||||
describe "#match?" do
|
||||
it "uses ===" do
|
||||
array = %i[a b c]
|
||||
spy = SpySUT.new
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({spy})
|
||||
matcher.match?(partial).should be_true
|
||||
spy.case_eq_call_count.should be > 0
|
||||
end
|
||||
|
||||
context "one argument" do
|
||||
context "against an equal value" do
|
||||
it "is true" do
|
||||
|
|
|
@ -2,6 +2,15 @@ require "../spec_helper"
|
|||
|
||||
describe Spectator::Matchers::HaveMatcher do
|
||||
describe "#match?" do
|
||||
it "uses ===" do
|
||||
array = %i[a b c]
|
||||
spy = SpySUT.new
|
||||
partial = Spectator::Expectations::ValueExpectationPartial.new(array)
|
||||
matcher = Spectator::Matchers::HaveMatcher.new({spy})
|
||||
matcher.match?(partial).should be_true
|
||||
spy.case_eq_call_count.should be > 0
|
||||
end
|
||||
|
||||
context "with a String" do
|
||||
context "one argument" do
|
||||
context "against a matching string" do
|
||||
|
|
Loading…
Reference in a new issue