diff --git a/src/spectator/matchers/equality_matcher.cr b/src/spectator/matchers/equality_matcher.cr index 1c3b00b..6a57cb5 100644 --- a/src/spectator/matchers/equality_matcher.cr +++ b/src/spectator/matchers/equality_matcher.cr @@ -10,6 +10,14 @@ module Spectator def match?(expectation : Expectation) expectation.actual == @expected end + + def message(expectation : Expectation) : String + "Expected #{expectation.actual} to equal #{@expected} (using ==)" + end + + def negated_message(expectation : Expectation) : String + "Expected #{expectation.actual} to not equal #{@expected} (using ==)" + end end end end diff --git a/src/spectator/matchers/matcher.cr b/src/spectator/matchers/matcher.cr index 3b847b2..414e62d 100644 --- a/src/spectator/matchers/matcher.cr +++ b/src/spectator/matchers/matcher.cr @@ -7,6 +7,8 @@ module Spectator end abstract def match?(expectation : Expectation) + abstract def message(expectation : Expectation) : String + abstract def negated_message(expectation : Expectation) : String end end end