Minor adjustments to equality matcher

This commit is contained in:
Michael Miller 2019-03-03 12:26:31 -07:00
parent ec06daaf35
commit 50a782b803
2 changed files with 9 additions and 9 deletions

View file

@ -1,6 +1,7 @@
require "../spec_helper"
describe Spectator::Matchers::EqualityMatcher do
describe "#match" do
it "compares using #==" do
spy = SpySUT.new
partial = new_partial(spy)
@ -9,7 +10,6 @@ describe Spectator::Matchers::EqualityMatcher do
spy.eq_call_count.should be > 0
end
describe "#match" do
context "returned MatchData" do
describe "#matched?" do
context "with identical values" do

View file

@ -11,7 +11,7 @@ module Spectator::Matchers
# Determines whether the matcher is satisfied with the partial given to it.
# `MatchData` is returned that contains information about the match.
def match(partial) : MatchData
def match(partial)
values = ExpectedActual.new(partial, self)
MatchData.new(match?(values.actual), values)
end