From 3abb48fe5348a1127242581ae114f78695c6a4f8 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Wed, 7 Nov 2018 12:55:38 -0700 Subject: [PATCH] Allow implicit subject to take arbitrary arguments This allows easy construction of the subject when it has an initializer with parameters. --- src/spectator/dsl/structure_dsl.cr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spectator/dsl/structure_dsl.cr b/src/spectator/dsl/structure_dsl.cr index 8a3f6b2..cdea7dc 100644 --- a/src/spectator/dsl/structure_dsl.cr +++ b/src/spectator/dsl/structure_dsl.cr @@ -268,8 +268,8 @@ module Spectator::DSL # Implicit subject definition. # Simply creates a new instance of the described type. - def subject - described_class.new + def subject(*args) + described_class.new(*args) end {% end %}