From 2dfca3ccf6d5af30a355a9a622626df8d6234d6c Mon Sep 17 00:00:00 2001 From: Pieter van de Bruggen Date: Thu, 24 Feb 2011 00:38:23 -0800 Subject: Adding tests proving behavior for several tag types. --- specs/dot-notation.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) 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"' -- cgit v1.2.1