From c1f61d68bff1b4b11be47e33f1ec203b83e8153f Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Tue, 26 Feb 2019 20:29:04 -0700 Subject: [PATCH] Use MatchData --- spec/helpers/expectations_helper.cr | 4 ++-- src/spectator/expectations/expectation.cr | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/helpers/expectations_helper.cr b/spec/helpers/expectations_helper.cr index bee6e18..6d0246c 100644 --- a/spec/helpers/expectations_helper.cr +++ b/spec/helpers/expectations_helper.cr @@ -19,8 +19,8 @@ end def new_expectation(expected : ExpectedType = 123, actual : ActualType = 123) forall ExpectedType, ActualType partial = new_partial(actual, "foo") matcher = new_matcher("bar", expected) - matched = matcher.match?(partial) - Spectator::Expectations::Expectation.new(matched, false, partial, matcher) + match_data = matcher.match(partial) + Spectator::Expectations::Expectation.new(match_data, false) end def new_satisfied_expectation(value : T = 123) forall T diff --git a/src/spectator/expectations/expectation.cr b/src/spectator/expectations/expectation.cr index 731f3b2..9a37858 100644 --- a/src/spectator/expectations/expectation.cr +++ b/src/spectator/expectations/expectation.cr @@ -7,7 +7,7 @@ module Spectator::Expectations # when the expectation was evaluated. # The *negated* flag and `MatchData#matched?` flag # are mutually-exclusive in this context. - def initialize(@match_data : MatchData, @negated : Bool) + def initialize(@match_data : Spectator::Matchers::MatchData, @negated : Bool) end # Indicates whether the expectation was satisifed.