Use label (expression string) instead of value

This commit is contained in:
Michael Miller 2018-09-24 22:58:35 -06:00
parent 371fe680c2
commit f63f8b15a0
2 changed files with 3 additions and 3 deletions

View file

@ -2,7 +2,7 @@ require "./matchers/matcher"
module Spectator module Spectator
class Expectation(T) class Expectation(T)
private getter label : String protected getter label : String
getter actual : T getter actual : T
protected def initialize(@label : String, @actual : T) protected def initialize(@label : String, @actual : T)

View file

@ -12,11 +12,11 @@ module Spectator
end end
def message(expectation : Expectation) : String def message(expectation : Expectation) : String
"Expected #{expectation.actual} to equal #{@expected} (using ==)" "Expected #{expectation.label} to equal #{label} (using ==)"
end end
def negated_message(expectation : Expectation) : String 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 end
end end