From 65e8ee378814780ce29799a9a081d4a8a6b322b2 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Tue, 11 Sep 2018 16:01:31 -0600 Subject: [PATCH] Fix string descriptions having extra quotes --- src/spectator/dsl.cr | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/spectator/dsl.cr b/src/spectator/dsl.cr index e3aac1f..85dc331 100644 --- a/src/spectator/dsl.cr +++ b/src/spectator/dsl.cr @@ -49,7 +49,7 @@ module Spectator include ::Spectator::DSL 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}} GIVEN_VARIABLES = [ @@ -96,7 +96,11 @@ module Spectator end def description - {{description.stringify}} + {% if description.is_a?(StringLiteral) %} + {{description}} + {% else %} + {{description.stringify}} + {% end %} end end