mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Use label (expression string) instead of value
This commit is contained in:
parent
371fe680c2
commit
f63f8b15a0
2 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue