From 65da494e52f76735dc3ba0b7f7949d0e91d7871a Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Mon, 10 Sep 2018 19:28:57 -0600 Subject: [PATCH] Fix for no block arg in #given - "value" treated as StringLiteral --- src/spectator/dsl.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spectator/dsl.cr b/src/spectator/dsl.cr index 5324973..9821792 100644 --- a/src/spectator/dsl.cr +++ b/src/spectator/dsl.cr @@ -105,7 +105,7 @@ module Spectator macro given(collection, &block) context({{collection}}, "Given") do - {% var_name = block.args.empty? ? "value" : block.args.first %} + {% var_name = block.args.empty? ? "value".id : block.args.first %} {% if GIVEN_VARIABLES.find { |v| v[0].id == var_name.id } %} {% raise "Duplicate given variable name \"#{var_name.id}\"" %} {% end %}