summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter van de Bruggen <pvande@gmail.com>2010-10-28 21:53:56 -0700
committerPieter van de Bruggen <pvande@gmail.com>2010-10-28 21:53:56 -0700
commit38141fea3f5647b10a3a05414b9a623410de166e (patch)
treecab6020b0d6265f1eeceac010ee18b73d3f9bda7
parent2d9859f72c8a80e1e528004a18721c97e8411fc9 (diff)
downloadmustache-spec-38141fea3f5647b10a3a05414b9a623410de166e.tar.gz
Highlighting a naïve mistake with lambda caching.
-rw-r--r--specs/lambdas.yml12
1 files changed, 12 insertions, 0 deletions
diff --git a/specs/lambdas.yml b/specs/lambdas.yml
index d61f456..692b41b 100644
--- a/specs/lambdas.yml
+++ b/specs/lambdas.yml
@@ -27,6 +27,18 @@ tests:
template: '{{lambda}} == {{{lambda}}} == {{lambda}}'
expected: '1 == 1 == 1'
+ - name: Interpolation - Caches
+ desc: Lambda caches should not disrupt normal context operations.
+ data:
+ key: Top
+ context:
+ key: Under
+ lambda: !code
+ ruby: 'proc { "Big" }'
+ perl: 'sub { "Big" }'
+ template: "{{#context}}{{key}} the {{lambda}}{{/context}} {{key}}"
+ expected: "Under the Big Top"
+
- name: Escaping
desc: Lambda results should be appropriately escaped.
data: