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
class Expectation(T)
private getter label : String
protected getter label : String
getter actual : T
protected def initialize(@label : String, @actual : T)

View file

@ -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