Rename MAPPING to GROUPS - better name

This commit is contained in:
Michael Miller 2018-09-19 18:58:44 -06:00
parent 41c0d9abc7
commit fe81341e1a
3 changed files with 9 additions and 9 deletions

View file

@ -1,7 +1,7 @@
module Spectator
module Definitions
ALL = {} of Path => Object
MAPPING = {} of String => ExampleGroup
GROUPS = {} of String => ExampleGroup
SPECIAL_CHARS = {
'~' => "Tilde",

View file

@ -12,10 +12,10 @@ module Spectator
module {{type.id}}%context
include {{@type.id}}
::Spectator::Definitions::MAPPING[\{{@type.stringify}}] =
::Spectator::Definitions::GROUPS[\{{@type.stringify}}] =
ExampleGroup.new(
{{what.is_a?(StringLiteral) ? what : what.stringify}},
::Spectator::Definitions::MAPPING[{{@type.stringify}}]
::Spectator::Definitions::GROUPS[{{@type.stringify}}]
)
_described_class {{what}}
@ -69,23 +69,23 @@ module Spectator
end
macro before_all(&block)
::Spectator::Definitions::MAPPING[{{@type.stringify}}].before_all_hooks << -> {{block}}
::Spectator::Definitions::GROUPS[{{@type.stringify}}].before_all_hooks << -> {{block}}
end
macro before_each(&block)
::Spectator::Definitions::MAPPING[{{@type.stringify}}].before_each_hooks << -> {{block}}
::Spectator::Definitions::GROUPS[{{@type.stringify}}].before_each_hooks << -> {{block}}
end
macro after_all(&block)
::Spectator::Definitions::MAPPING[{{@type.stringify}}].after_all_hooks << -> {{block}}
::Spectator::Definitions::GROUPS[{{@type.stringify}}].after_all_hooks << -> {{block}}
end
macro after_each(&block)
::Spectator::Definitions::MAPPING[{{@type.stringify}}].after_each_hooks << -> {{block}}
::Spectator::Definitions::GROUPS[{{@type.stringify}}].after_each_hooks << -> {{block}}
end
macro around_each(&block)
::Spectator::Definitions::MAPPING[{{@type.stringify}}].around_each_hooks << Proc(Proc(Nil), Nil).new {{block}}
::Spectator::Definitions::GROUPS[{{@type.stringify}}].around_each_hooks << Proc(Proc(Nil), Nil).new {{block}}
end
def include_examples

View file

@ -11,6 +11,6 @@ module Spectator
given: [] of Object,
children: [] of Object
} %}
::Spectator::Definitions::MAPPING[{{@type.stringify}}] = ::Spectator::ExampleGroup::ROOT
::Spectator::Definitions::GROUPS[{{@type.stringify}}] = ::Spectator::ExampleGroup::ROOT
end
end