diff --git a/src/spectator/dsl/groups.cr b/src/spectator/dsl/groups.cr index bce9215..227c224 100644 --- a/src/spectator/dsl/groups.cr +++ b/src/spectator/dsl/groups.cr @@ -24,11 +24,11 @@ module Spectator {{what}} end - def subject(*args) + def _spectator_implicit_subject(*args) described_class.new(*args) end {% else %} - def subject + def _spectator_implicit_subject(*args) {{what}} end {% end %} diff --git a/src/spectator_test.cr b/src/spectator_test.cr index 364d79e..ca0e2e0 100644 --- a/src/spectator_test.cr +++ b/src/spectator_test.cr @@ -6,6 +6,14 @@ require "./spectator/dsl" class SpectatorTest include ::Spectator::DSL + def _spectator_implicit_subject + nil + end + + def subject + _spectator_implicit_subject + end + def initialize(@spectator_test_values : ::Spectator::TestValues) end end