summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter van de Bruggen <pvande@gmail.com>2010-10-24 13:25:14 -0700
committerPieter van de Bruggen <pvande@gmail.com>2010-10-24 13:25:14 -0700
commit98bd4d91ce7283ff2fd30f6bee24e051f443e99c (patch)
treec80ce971990d972926ebeca8349ad922ddab72f0
parentb6d732fa0ed1d0d78f16a0ddbf1b0b28d9bdd363 (diff)
downloadmustache-spec-98bd4d91ce7283ff2fd30f6bee24e051f443e99c.tar.gz
The Multiple Calls spec cannot rely on arguments.
-rw-r--r--specs/lambdas.yml10
1 files 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'