mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Default reason for missing example block "Not yet implemented"
This commit is contained in:
parent
6f4cc12dfd
commit
bfbeaf7454
3 changed files with 10 additions and 6 deletions
|
@ -68,7 +68,8 @@ module Spectator::DSL
|
|||
::Spectator::DSL::Builder.add_pending_example(
|
||||
_spectator_example_name(\{{what}}),
|
||||
::Spectator::Location.new(\{{what.filename}}, \{{what.line_number}}),
|
||||
\%tags
|
||||
\%tags,
|
||||
"Not yet implemented"
|
||||
)
|
||||
\{% end %}
|
||||
end
|
||||
|
@ -110,7 +111,8 @@ module Spectator::DSL
|
|||
::Spectator::DSL::Builder.add_pending_example(
|
||||
_spectator_example_name(\{{what}}),
|
||||
::Spectator::Location.new(\{{(what || block).filename}}, \{{(what || block).line_number}}, \{{(what || block).end_line_number}}),
|
||||
\%tags
|
||||
\%tags,
|
||||
"Not yet implemented"
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -74,8 +74,9 @@ module Spectator
|
|||
# A set of *tags* can be used for filtering and modifying example behavior.
|
||||
# Note: The tags will not be merged with the parent tags.
|
||||
def self.pending(name : String? = nil, location : Location? = nil,
|
||||
group : ExampleGroup? = nil, tags = Tags.new)
|
||||
tags = tags.merge({:pending => nil}) { |_, v, _| v } # Add pending tag if it doesn't exist.
|
||||
group : ExampleGroup? = nil, tags = Tags.new, reason = nil)
|
||||
# Add pending tag and reason if they don't exist.
|
||||
tags = tags.merge({:pending => nil, :reason => reason}) { |_, v, _| v }
|
||||
new(name, location, group, tags) { nil }
|
||||
end
|
||||
|
||||
|
|
|
@ -116,11 +116,12 @@ module Spectator
|
|||
#
|
||||
# A set of *tags* can be used for filtering and modifying example behavior.
|
||||
# For instance, adding a "pending" tag will mark the test as pending and skip execution.
|
||||
# A default *reason* can be given in case the user didn't provide one.
|
||||
#
|
||||
# The newly created example is returned.
|
||||
def add_pending_example(name, location, tags = Tags.new) : Example
|
||||
def add_pending_example(name, location, tags = Tags.new, reason = nil) : Example
|
||||
Log.trace { "Add pending example: #{name} @ #{location}; tags: #{tags}" }
|
||||
Example.pending(name, location, current_group, tags)
|
||||
Example.pending(name, location, current_group, tags, reason)
|
||||
# The example is added to the current group by `Example` initializer.
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue