mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Fix let/subject not being passed to nested contexts
This commit is contained in:
parent
24725c4f9d
commit
e26fecd092
2 changed files with 9 additions and 0 deletions
|
@ -13,10 +13,14 @@ module Spectator
|
|||
macro context(what, type = "Context", &block)
|
||||
{% safe_name = what.id.stringify.gsub(/\W+/, "_") %}
|
||||
{% module_name = (type.id + safe_name.camelcase).id %}
|
||||
{% parent_context_name = PARENT_CONTEXT_NAME %}
|
||||
module {{module_name.id}}
|
||||
include ::Spectator::DSL
|
||||
|
||||
PARENT_CONTEXT_NAME = {{parent_context_name.id}}::{{module_name.id}}
|
||||
|
||||
module Context
|
||||
include {{parent_context_name.id}}::Context
|
||||
end
|
||||
|
||||
{{block.body}}
|
||||
|
|
|
@ -3,5 +3,10 @@ require "./dsl"
|
|||
module Spectator
|
||||
module Examples
|
||||
include ::Spectator::DSL
|
||||
|
||||
PARENT_CONTEXT_NAME = ::Spectator::Examples
|
||||
|
||||
module Context
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue