diff options
author | Pieter van de Bruggen <pvande@gmail.com> | 2011-02-25 15:34:03 -0800 |
---|---|---|
committer | Pieter van de Bruggen <pvande@gmail.com> | 2011-02-25 15:34:03 -0800 |
commit | f778edad3a048d19dc75c777cfc22d20f238c0e9 (patch) | |
tree | 0ee2f9bd6168b21e1c2071be1335cad26a577295 /specs/interpolation.yml | |
parent | f6cadccc777d8f9bda86826f3dd213723e64b0fc (diff) | |
download | mustache-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.yml | 20 |
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 |