From 60ca4361de022972330c14fd1c6d7c6ad99d4cf0 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Thu, 26 Sep 2019 21:44:25 -0600 Subject: [PATCH] Fix implicit subject --- src/spectator/dsl/groups.cr | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/spectator/dsl/groups.cr b/src/spectator/dsl/groups.cr index 1e1386c..8153b0e 100644 --- a/src/spectator/dsl/groups.cr +++ b/src/spectator/dsl/groups.cr @@ -2,26 +2,26 @@ require "../spec_builder" module Spectator module DSL - macro context(description, _source_file = __FILE__, _source_line = __LINE__, &block) + macro context(what, _source_file = __FILE__, _source_line = __LINE__, &block) class Context%context < {{@type.id}} {% - description = if description.is_a?(StringLiteral) - if description.starts_with?("#") || description.starts_with?(".") - description.id.symbolize + description = if what.is_a?(StringLiteral) + if what.starts_with?("#") || what.starts_with?(".") + what.id.symbolize else - description + what end else - description.symbolize + what.symbolize end %} %source = ::Spectator::Source.new({{_source_file}}, {{_source_line}}) ::Spectator::SpecBuilder.start_group({{description}}, %source) - {% if description.is_a?(Path) || description.is_a?(Generic) %} + {% if what.is_a?(Path) || what.is_a?(Generic) %} macro described_class - {{description}} + {{what}} end def subject(*args) @@ -35,8 +35,8 @@ module Spectator end end - macro describe(description, &block) - context({{description}}) {{block}} + macro describe(what, &block) + context({{what}}) {{block}} end macro sample(collection, count = nil, _source_file = __FILE__, _source_line = __LINE__, &block)