mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Minor adjustments to equality matcher
This commit is contained in:
parent
ec06daaf35
commit
50a782b803
2 changed files with 9 additions and 9 deletions
|
@ -1,15 +1,15 @@
|
||||||
require "../spec_helper"
|
require "../spec_helper"
|
||||||
|
|
||||||
describe Spectator::Matchers::EqualityMatcher do
|
describe Spectator::Matchers::EqualityMatcher do
|
||||||
it "compares using #==" do
|
|
||||||
spy = SpySUT.new
|
|
||||||
partial = new_partial(spy)
|
|
||||||
matcher = Spectator::Matchers::EqualityMatcher.new(42)
|
|
||||||
matcher.match(partial)
|
|
||||||
spy.eq_call_count.should be > 0
|
|
||||||
end
|
|
||||||
|
|
||||||
describe "#match" do
|
describe "#match" do
|
||||||
|
it "compares using #==" do
|
||||||
|
spy = SpySUT.new
|
||||||
|
partial = new_partial(spy)
|
||||||
|
matcher = Spectator::Matchers::EqualityMatcher.new(42)
|
||||||
|
matcher.match(partial)
|
||||||
|
spy.eq_call_count.should be > 0
|
||||||
|
end
|
||||||
|
|
||||||
context "returned MatchData" do
|
context "returned MatchData" do
|
||||||
describe "#matched?" do
|
describe "#matched?" do
|
||||||
context "with identical values" do
|
context "with identical values" do
|
||||||
|
|
|
@ -11,7 +11,7 @@ module Spectator::Matchers
|
||||||
|
|
||||||
# Determines whether the matcher is satisfied with the partial given to it.
|
# Determines whether the matcher is satisfied with the partial given to it.
|
||||||
# `MatchData` is returned that contains information about the match.
|
# `MatchData` is returned that contains information about the match.
|
||||||
def match(partial) : MatchData
|
def match(partial)
|
||||||
values = ExpectedActual.new(partial, self)
|
values = ExpectedActual.new(partial, self)
|
||||||
MatchData.new(match?(values.actual), values)
|
MatchData.new(match?(values.actual), values)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue