summaryrefslogtreecommitdiff
path: root/specs/interpolation.yml
diff options
context:
space:
mode:
authorPieter van de Bruggen <pvande@gmail.com>2011-02-25 15:34:03 -0800
committerPieter van de Bruggen <pvande@gmail.com>2011-02-25 15:34:03 -0800
commitf778edad3a048d19dc75c777cfc22d20f238c0e9 (patch)
tree0ee2f9bd6168b21e1c2071be1335cad26a577295 /specs/interpolation.yml
parentf6cadccc777d8f9bda86826f3dd213723e64b0fc (diff)
downloadmustache-spec-f778edad3a048d19dc75c777cfc22d20f238c0e9.tar.gz
Specifying behavior for context 'misses'.
Context 'misses' should always interpolate as the empty string (by default), and should be considered falsey in Section tags.
Diffstat (limited to 'specs/interpolation.yml')
-rw-r--r--specs/interpolation.yml20
1 files changed, 20 insertions, 0 deletions
diff --git a/specs/interpolation.yml b/specs/interpolation.yml
index 1fa5f08..a963899 100644
--- a/specs/interpolation.yml
+++ b/specs/interpolation.yml
@@ -75,6 +75,26 @@ tests:
template: '"{{&power}} jiggawatts!"'
expected: '"1.21 jiggawatts!"'
+ # Context Misses
+
+ - name: Basic Context Miss Interpolation
+ desc: Failed context lookups should default to empty strings.
+ data: { }
+ template: "I ({{cannot}}) be seen!"
+ expected: "I () be seen!"
+
+ - name: Triple Mustache Context Miss Interpolation
+ desc: Failed context lookups should default to empty strings.
+ data: { }
+ template: "I ({{{cannot}}}) be seen!"
+ expected: "I () be seen!"
+
+ - name: Ampersand Context Miss Interpolation
+ desc: Failed context lookups should default to empty strings.
+ data: { }
+ template: "I ({{&cannot}}) be seen!"
+ expected: "I () be seen!"
+
# Whitespace Sensitivity
- name: Interpolation - Surrounding Whitespace