mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Pass along fallback reason
This commit is contained in:
parent
1b53607f8e
commit
af13a89257
2 changed files with 5 additions and 3 deletions
|
@ -9,14 +9,16 @@ module Spectator
|
||||||
class PendingExampleBuilder < NodeBuilder
|
class PendingExampleBuilder < NodeBuilder
|
||||||
# Creates the builder.
|
# Creates the builder.
|
||||||
# The *name*, *location*, and *metadata* will be applied to the `Example` produced by `#build`.
|
# The *name*, *location*, and *metadata* will be applied to the `Example` produced by `#build`.
|
||||||
def initialize(@name : String? = nil, @location : Location? = nil, @metadata : Metadata = Metadata.new)
|
# A default *reason* can be given in case the user didn't provide one.
|
||||||
|
def initialize(@name : String? = nil, @location : Location? = nil,
|
||||||
|
@metadata : Metadata = Metadata.new, @reason : String? = nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Constructs an example with previously defined attributes.
|
# Constructs an example with previously defined attributes.
|
||||||
# The *parent* is an already constructed example group to nest the new example under.
|
# The *parent* is an already constructed example group to nest the new example under.
|
||||||
# It can be nil if the new example won't have a parent.
|
# It can be nil if the new example won't have a parent.
|
||||||
def build(parent = nil)
|
def build(parent = nil)
|
||||||
Example.pending(@name, @location, parent, @metadata)
|
Example.pending(@name, @location, parent, @metadata, @reason)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -132,7 +132,7 @@ module Spectator
|
||||||
# A default *reason* can be given in case the user didn't provide one.
|
# A default *reason* can be given in case the user didn't provide one.
|
||||||
def add_pending_example(name, location, metadata = Metadata.new, reason = nil) : Nil
|
def add_pending_example(name, location, metadata = Metadata.new, reason = nil) : Nil
|
||||||
Log.trace { "Add pending example: #{name} @ #{location}; metadata: #{metadata}" }
|
Log.trace { "Add pending example: #{name} @ #{location}; metadata: #{metadata}" }
|
||||||
current << PendingExampleBuilder.new(name, location, metadata)
|
current << PendingExampleBuilder.new(name, location, metadata, reason)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Attaches a hook to be invoked before any and all examples in the current group.
|
# Attaches a hook to be invoked before any and all examples in the current group.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue