From c49522a791982a3911fa7a2f147407ce0004b7d5 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Wed, 18 Aug 2021 15:57:22 -0600 Subject: [PATCH] Allow tags on top-level groups --- src/spectator/dsl/top.cr | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/spectator/dsl/top.cr b/src/spectator/dsl/top.cr index 467b415..e70dd8f 100644 --- a/src/spectator/dsl/top.cr +++ b/src/spectator/dsl/top.cr @@ -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 %}