Fix for no block arg in #given - "value" treated as StringLiteral

This commit is contained in:
Michael Miller 2018-09-10 19:28:57 -06:00
parent b1d44fb480
commit 65da494e52

View file

@ -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 %}