mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Use actual value if label is empty
This will show a value instead of nothing if the should-syntax is used.
This commit is contained in:
parent
77b4c71c2a
commit
b9abdb86ff
1 changed files with 4 additions and 1 deletions
|
@ -2,9 +2,12 @@ require "./matchers/matcher"
|
||||||
|
|
||||||
module Spectator
|
module Spectator
|
||||||
class Expectation(T)
|
class Expectation(T)
|
||||||
protected getter label : String
|
|
||||||
getter actual : T
|
getter actual : T
|
||||||
|
|
||||||
|
protected def label : String
|
||||||
|
@label.empty? ? @actual.to_s : @label
|
||||||
|
end
|
||||||
|
|
||||||
protected def initialize(@label : String, @actual : T)
|
protected def initialize(@label : String, @actual : T)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue