From 98bd4d91ce7283ff2fd30f6bee24e051f443e99c Mon Sep 17 00:00:00 2001 From: Pieter van de Bruggen Date: Sun, 24 Oct 2010 13:25:14 -0700 Subject: The Multiple Calls spec cannot rely on arguments. --- specs/lambdas.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/specs/lambdas.yml b/specs/lambdas.yml index 8612025..355cebf 100644 --- a/specs/lambdas.yml +++ b/specs/lambdas.yml @@ -21,15 +21,9 @@ tests: - name: Interpolation - Multiple Calls desc: Interpolated lambdas should only be called once. data: - calls: 0 lambda: !code - ruby: 'proc { |ctx| ctx["calls"] += 1 }' - perl: | - sub { - my ($ctx) = @_; - $ctx->set("calls" => $ctx->get("calls") + 1); - $ctx->get("calls"); - } + ruby: 'proc { ($calls ||= 0) += 1 }' + perl: 'sub { no strict; $calls += 1 }' template: '{{lambda}} == {{{lambda}}} == {{lambda}}' expected: '1 == 1 == 1' -- cgit v1.2.1