mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Check pending, skip, and reason tags for reason
This commit is contained in:
parent
12cba23fa3
commit
a061bd2044
2 changed files with 9 additions and 1 deletions
|
@ -89,7 +89,7 @@ module Spectator
|
|||
if pending?
|
||||
Log.debug { "Skipping example #{self} - marked pending" }
|
||||
@finished = true
|
||||
return @result = PendingResult.new(tags[:pending] || PendingResult::DEFAULT_REASON)
|
||||
return @result = PendingResult.new(pending_reason)
|
||||
end
|
||||
|
||||
previous_example = @@current
|
||||
|
|
|
@ -7,6 +7,9 @@ module Spectator
|
|||
# This is commonly an `Example` or `ExampleGroup`,
|
||||
# but can be anything that should be iterated over when running the spec.
|
||||
abstract class Node
|
||||
# Default text used if none was given by the user for skipping a node.
|
||||
DEFAULT_PENDING_REASON = "No reason given"
|
||||
|
||||
# Location of the node in source code.
|
||||
getter! location : Location
|
||||
|
||||
|
@ -46,6 +49,11 @@ module Spectator
|
|||
tags.has_key?(:pending) || tags.has_key?(:skip)
|
||||
end
|
||||
|
||||
# Gets the reason the node has been marked as pending.
|
||||
def pending_reason
|
||||
tags[:pending]? || tags[:skip]? || tags[:reason]? || DEFAULT_PENDING_REASON
|
||||
end
|
||||
|
||||
# Constructs the full name or description of the node.
|
||||
# This prepends names of groups this node is part of.
|
||||
def to_s(io)
|
||||
|
|
Loading…
Reference in a new issue