From 788b12a8bcccb9d52ee6ccacc1f980e4276b6eee Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sat, 17 Oct 2020 12:12:04 -0600 Subject: [PATCH] Fix example methods overriding previously defined methods --- src/spectator/dsl/examples.cr | 4 ++-- src/spectator/dsl/groups.cr | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/spectator/dsl/examples.cr b/src/spectator/dsl/examples.cr index 0082fc5..e245f79 100644 --- a/src/spectator/dsl/examples.cr +++ b/src/spectator/dsl/examples.cr @@ -7,7 +7,7 @@ module Spectator::DSL macro {{name.id}}(what = nil, &block) \{% raise "Cannot use '{{name.id}}' inside of a test block" if @def %} - def %test + def \%test \{{block.body}} end @@ -15,7 +15,7 @@ module Spectator::DSL _spectator_example_name(\{{what}}), ::Spectator::Source.new(\{{block.filename}}, \{{block.line_number}}), \{{@type.name}}.new - ) { |example, context| context.as(\{{@type.name}}).%test } + ) { |example, context| context.as(\{{@type.name}}).\%test } end end diff --git a/src/spectator/dsl/groups.cr b/src/spectator/dsl/groups.cr index 2d82ecf..15deaac 100644 --- a/src/spectator/dsl/groups.cr +++ b/src/spectator/dsl/groups.cr @@ -13,7 +13,7 @@ module Spectator::DSL macro {{name.id}}(what, &block) \{% raise "Cannot use '{{name.id}}' inside of a test block" if @def %} - class Group%group < \{{@type.id}} + class Group\%group < \{{@type.id}} _spectator_group_subject(\{{what}}) ::Spectator::DSL::Builder.start_group(