From 1c5b46b981361875491db5cb806a23796ed57a2f Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sun, 1 Sep 2019 00:54:04 -0600 Subject: [PATCH] Use fresh variables --- src/spectator/dsl/example_dsl.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/spectator/dsl/example_dsl.cr b/src/spectator/dsl/example_dsl.cr index 5fea5a7..95f4a1c 100644 --- a/src/spectator/dsl/example_dsl.cr +++ b/src/spectator/dsl/example_dsl.cr @@ -23,9 +23,9 @@ module Spectator::DSL # Where the actual value is returned by the system-under-test, # and the expected value is what the actual value should be to satisfy the condition. macro expect(actual, _source_file = __FILE__, _source_line = __LINE__) - test_value = ::Spectator::TestValue.new({{actual}}, {{actual.stringify}}) - source = ::Spectator::Source.new({{_source_file}}, {{_source_line}}) - ::Spectator::Expectations::ExpectationPartial.new(test_value, source) + %test_value = ::Spectator::TestValue.new({{actual}}, {{actual.stringify}}) + %source = ::Spectator::Source.new({{_source_file}}, {{_source_line}}) + ::Spectator::Expectations::ExpectationPartial.new(%test_value, %source) end # Starts an expectation on a block of code.