summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter van de Bruggen <pvande@gmail.com>2011-02-24 00:38:23 -0800
committerPieter van de Bruggen <pvande@gmail.com>2011-02-24 00:38:23 -0800
commit2dfca3ccf6d5af30a355a9a622626df8d6234d6c (patch)
tree27d8c1544beeb583f5cd9199bc21febc27835415
parentdeaedb83d5536a8438348b3d32819f93220cecff (diff)
downloadmustache-spec-2dfca3ccf6d5af30a355a9a622626df8d6234d6c.tar.gz
Adding tests proving behavior for several tag types.
-rw-r--r--specs/dot-notation.yml32
1 files changed, 32 insertions, 0 deletions
diff --git a/specs/dot-notation.yml b/specs/dot-notation.yml
index ba50055..c1fc114 100644
--- a/specs/dot-notation.yml
+++ b/specs/dot-notation.yml
@@ -34,3 +34,35 @@ tests:
b: { c: { d: { e: { name: 'Wrong' } } } }
template: '"{{#a}}{{b.c.d.e.name}}{{/a}}" == "Phil"'
expected: '"Phil" == "Phil"'
+
+ # Tag Compatibility
+
+ - name: Unescaped Interpolation
+ desc: Dot notation should be functional with all basic tag types.
+ data: { person: { name: 'Joe' } }
+ template: '"{{{person.name}}}" == "{{#person}}{{{name}}}{{/person}}"'
+ expected: '"Joe" == "Joe"'
+
+ - name: Sections (Truthy)
+ desc: Dot notation should be functional with all basic tag types.
+ data: { person: { present: true } }
+ template: '"{{#person.present}}Here{{/person.present}}" == "Here"'
+ expected: '"Here" == "Here"'
+
+ - name: Sections (Falsey)
+ desc: Dot notation should be functional with all basic tag types.
+ data: { person: { present: false } }
+ template: '"{{#person.present}}Here{{/person.present}}" == ""'
+ expected: '"" == ""'
+
+ - name: Inverted Sections (Truthy)
+ desc: Dot notation should be functional with all basic tag types.
+ data: { person: { present: true } }
+ template: '"{{^person.present}}Not Here{{/person.present}}" == ""'
+ expected: '"" == ""'
+
+ - name: Inverted Sections (Falsey)
+ desc: Dot notation should be functional with all basic tag types.
+ data: { person: { present: false } }
+ template: '"{{^person.present}}Not Here{{/person.present}}" == "Not Here"'
+ expected: '"Not Here" == "Not Here"'