From 71740113d57a8c02b5e2761032ea72a7fe456571 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Thu, 2 Jan 2020 19:30:46 -0700 Subject: [PATCH] Allow subject for non-class types --- src/spectator/dsl/groups.cr | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/spectator/dsl/groups.cr b/src/spectator/dsl/groups.cr index 8153b0e..bce9215 100644 --- a/src/spectator/dsl/groups.cr +++ b/src/spectator/dsl/groups.cr @@ -19,7 +19,7 @@ module Spectator %source = ::Spectator::Source.new({{_source_file}}, {{_source_line}}) ::Spectator::SpecBuilder.start_group({{description}}, %source) - {% if what.is_a?(Path) || what.is_a?(Generic) %} + {% if (what.is_a?(Path) || what.is_a?(Generic)) && what.resolve? %} macro described_class {{what}} end @@ -27,6 +27,10 @@ module Spectator def subject(*args) described_class.new(*args) end + {% else %} + def subject + {{what}} + end {% end %} {{block.body}}