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?
|
if pending?
|
||||||
Log.debug { "Skipping example #{self} - marked pending" }
|
Log.debug { "Skipping example #{self} - marked pending" }
|
||||||
@finished = true
|
@finished = true
|
||||||
return @result = PendingResult.new(tags[:pending] || PendingResult::DEFAULT_REASON)
|
return @result = PendingResult.new(pending_reason)
|
||||||
end
|
end
|
||||||
|
|
||||||
previous_example = @@current
|
previous_example = @@current
|
||||||
|
|
|
@ -7,6 +7,9 @@ module Spectator
|
||||||
# This is commonly an `Example` or `ExampleGroup`,
|
# This is commonly an `Example` or `ExampleGroup`,
|
||||||
# but can be anything that should be iterated over when running the spec.
|
# but can be anything that should be iterated over when running the spec.
|
||||||
abstract class Node
|
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.
|
# Location of the node in source code.
|
||||||
getter! location : Location
|
getter! location : Location
|
||||||
|
|
||||||
|
@ -46,6 +49,11 @@ module Spectator
|
||||||
tags.has_key?(:pending) || tags.has_key?(:skip)
|
tags.has_key?(:pending) || tags.has_key?(:skip)
|
||||||
end
|
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.
|
# Constructs the full name or description of the node.
|
||||||
# This prepends names of groups this node is part of.
|
# This prepends names of groups this node is part of.
|
||||||
def to_s(io)
|
def to_s(io)
|
||||||
|
|
Loading…
Reference in a new issue