Allow tags on top-level groups

This commit is contained in:
Michael Miller 2021-08-18 15:57:22 -06:00
parent 21d14bd814
commit c49522a791
No known key found for this signature in database
GPG Key ID: F9A0C5C65B162436
1 changed files with 7 additions and 2 deletions

View File

@ -10,16 +10,21 @@ module Spectator::DSL
# It can be any Crystal expression,
# but is typically a class name or feature string.
# The block should contain all of the examples for what is being described.
#
# Example:
# ```
# Spectator.describe Foo do
# # Your examples for `Foo` go here.
# 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.
macro {{method.id}}(description, &block)
macro {{method.id}}(description, *tags, **metadata, &block)
class ::SpectatorTestContext
{{method.id}}(\{{description}}) \{{block}}
{{method.id}}(\{{description}}, \{{tags.splat(", ")}} \{{metadata.double_splat}}) \{{block}}
end
end
{% end %}