Use more correct name for constant

This commit is contained in:
Michael Miller 2018-09-06 19:22:47 -06:00
parent f7eeb2b2a3
commit 3e7f43009f
2 changed files with 4 additions and 4 deletions

View file

@ -9,14 +9,14 @@ module Spectator
macro context(what, source_file = __FILE__, source_line = __LINE__, type = "Context", &block)
{% safe_name = what.id.stringify.gsub(/\W+/, "_") %}
{% module_name = (type.id + safe_name.camelcase).id %}
{% parent_locals_module = PARENT_LOCALS_MODULE %}
{% context_module = CONTEXT_MODULE %}
module {{module_name.id}}
include ::Spectator::DSL
PARENT_LOCALS_MODULE = {{parent_locals_module.id}}::{{module_name.id}}
CONTEXT_MODULE = {{context_module.id}}::{{module_name.id}}
module Locals
include {{parent_locals_module.id}}::Locals
include {{context_module.id}}::Locals
{% if what.is_a?(Path) %}
def described_class

View file

@ -4,7 +4,7 @@ module Spectator
module Examples
include ::Spectator::DSL
PARENT_LOCALS_MODULE = ::Spectator::Examples
CONTEXT_MODULE = ::Spectator::Examples
module Locals
end