mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Allow tags on top-level groups
This commit is contained in:
parent
21d14bd814
commit
c49522a791
1 changed files with 7 additions and 2 deletions
|
@ -10,16 +10,21 @@ module Spectator::DSL
|
||||||
# It can be any Crystal expression,
|
# It can be any Crystal expression,
|
||||||
# but is typically a class name or feature string.
|
# but is typically a class name or feature string.
|
||||||
# The block should contain all of the examples for what is being described.
|
# The block should contain all of the examples for what is being described.
|
||||||
|
#
|
||||||
# Example:
|
# Example:
|
||||||
# ```
|
# ```
|
||||||
# Spectator.describe Foo do
|
# Spectator.describe Foo do
|
||||||
# # Your examples for `Foo` go here.
|
# # Your examples for `Foo` go here.
|
||||||
# end
|
# end
|
||||||
# ```
|
# ```
|
||||||
|
#
|
||||||
|
# Tags can be specified by adding symbols (keywords) after the first argument.
|
||||||
|
# Key-value pairs can also be specified.
|
||||||
|
#
|
||||||
# NOTE: Inside the block, the `Spectator` prefix _should not_ be used.
|
# NOTE: Inside the block, the `Spectator` prefix _should not_ be used.
|
||||||
macro {{method.id}}(description, &block)
|
macro {{method.id}}(description, *tags, **metadata, &block)
|
||||||
class ::SpectatorTestContext
|
class ::SpectatorTestContext
|
||||||
{{method.id}}(\{{description}}) \{{block}}
|
{{method.id}}(\{{description}}, \{{tags.splat(", ")}} \{{metadata.double_splat}}) \{{block}}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|
Loading…
Reference in a new issue