Fix string descriptions having extra quotes

This commit is contained in:
Michael Miller 2018-09-11 16:01:31 -06:00
parent 84ed9c41b2
commit 65e8ee3788

View file

@ -49,7 +49,7 @@ module Spectator
include ::Spectator::DSL include ::Spectator::DSL
PARENT_CONTEXT = {{context_module.id}}::CURRENT_CONTEXT PARENT_CONTEXT = {{context_module.id}}::CURRENT_CONTEXT
CURRENT_CONTEXT = ::Spectator::Context.new({{what.stringify}}, PARENT_CONTEXT) CURRENT_CONTEXT = ::Spectator::Context.new({{what.is_a?(StringLiteral) ? what : what.stringify}}, PARENT_CONTEXT)
CONTEXT_MODULE = {{context_module.id}}::{{module_name.id}} CONTEXT_MODULE = {{context_module.id}}::{{module_name.id}}
GIVEN_VARIABLES = [ GIVEN_VARIABLES = [
@ -96,7 +96,11 @@ module Spectator
end end
def description def description
{{description.stringify}} {% if description.is_a?(StringLiteral) %}
{{description}}
{% else %}
{{description.stringify}}
{% end %}
end end
end end