diff --git a/src/spectator/expectation.cr b/src/spectator/expectation.cr index 1f72bb0..8d10b72 100644 --- a/src/spectator/expectation.cr +++ b/src/spectator/expectation.cr @@ -2,7 +2,7 @@ require "./matchers/matcher" module Spectator class Expectation(T) - private getter label : String + protected getter label : String getter actual : T protected def initialize(@label : String, @actual : T) diff --git a/src/spectator/matchers/equality_matcher.cr b/src/spectator/matchers/equality_matcher.cr index 6a57cb5..dfc1a69 100644 --- a/src/spectator/matchers/equality_matcher.cr +++ b/src/spectator/matchers/equality_matcher.cr @@ -12,11 +12,11 @@ module Spectator end def message(expectation : Expectation) : String - "Expected #{expectation.actual} to equal #{@expected} (using ==)" + "Expected #{expectation.label} to equal #{label} (using ==)" end def negated_message(expectation : Expectation) : String - "Expected #{expectation.actual} to not equal #{@expected} (using ==)" + "Expected #{expectation.label} to not equal #{label} (using ==)" end end end