From 50a782b80364e3694ba048c58fd21b1331e0fb06 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sun, 3 Mar 2019 12:26:31 -0700 Subject: [PATCH] Minor adjustments to equality matcher --- spec/matchers/equality_matcher_spec.cr | 16 ++++++++-------- src/spectator/matchers/equality_matcher.cr | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/matchers/equality_matcher_spec.cr b/spec/matchers/equality_matcher_spec.cr index 1c6804e..6f0e386 100644 --- a/spec/matchers/equality_matcher_spec.cr +++ b/spec/matchers/equality_matcher_spec.cr @@ -1,15 +1,15 @@ require "../spec_helper" 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 + 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 describe "#matched?" do context "with identical values" do diff --git a/src/spectator/matchers/equality_matcher.cr b/src/spectator/matchers/equality_matcher.cr index 49914a3..63a5354 100644 --- a/src/spectator/matchers/equality_matcher.cr +++ b/src/spectator/matchers/equality_matcher.cr @@ -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