From fe81341e1af931cddd0aa772272ac5aee7f7913a Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Wed, 19 Sep 2018 18:58:44 -0600 Subject: [PATCH] Rename MAPPING to GROUPS - better name --- src/spectator/definitions.cr | 2 +- src/spectator/dsl/structure_dsl.cr | 14 +++++++------- src/spectator/examples.cr | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/spectator/definitions.cr b/src/spectator/definitions.cr index dc3d756..b2d7753 100644 --- a/src/spectator/definitions.cr +++ b/src/spectator/definitions.cr @@ -1,7 +1,7 @@ module Spectator module Definitions ALL = {} of Path => Object - MAPPING = {} of String => ExampleGroup + GROUPS = {} of String => ExampleGroup SPECIAL_CHARS = { '~' => "Tilde", diff --git a/src/spectator/dsl/structure_dsl.cr b/src/spectator/dsl/structure_dsl.cr index f44bc35..0ef24c5 100644 --- a/src/spectator/dsl/structure_dsl.cr +++ b/src/spectator/dsl/structure_dsl.cr @@ -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 diff --git a/src/spectator/examples.cr b/src/spectator/examples.cr index b1eb3d0..7acfbfd 100644 --- a/src/spectator/examples.cr +++ b/src/spectator/examples.cr @@ -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