mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Display actual value if label is empty
This commit is contained in:
parent
38da6615bf
commit
7277b3caaf
1 changed files with 6 additions and 0 deletions
|
@ -12,6 +12,12 @@ module Spectator::Expectations
|
||||||
super(label)
|
super(label)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Returns the actual value as a string
|
||||||
|
# if there's no label available.
|
||||||
|
def label
|
||||||
|
super.empty? ? actual.to_s : super
|
||||||
|
end
|
||||||
|
|
||||||
# Asserts that the `#actual` value matches some criteria.
|
# Asserts that the `#actual` value matches some criteria.
|
||||||
# The criteria is defined by the matcher passed to this method.
|
# The criteria is defined by the matcher passed to this method.
|
||||||
def to(matcher : Matchers::ValueMatcher(ExpectedType)) : Nil forall ExpectedType
|
def to(matcher : Matchers::ValueMatcher(ExpectedType)) : Nil forall ExpectedType
|
||||||
|
|
Loading…
Reference in a new issue