Allow subject for non-class types

This commit is contained in:
Michael Miller 2020-01-02 19:30:46 -07:00
parent 88ed415191
commit 71740113d5

View file

@ -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}}