diff options
-rw-r--r-- | specs/inverted.json | 9 | ||||
-rw-r--r-- | specs/inverted.yml | 6 | ||||
-rw-r--r-- | specs/sections.json | 9 | ||||
-rw-r--r-- | specs/sections.yml | 6 |
4 files changed, 30 insertions, 0 deletions
diff --git a/specs/inverted.json b/specs/inverted.json index d9a7c15..5e881d1 100644 --- a/specs/inverted.json +++ b/specs/inverted.json @@ -21,6 +21,15 @@ "expected": "\"\"" }, { + "name": "Null is falsey", + "desc": "Null is falsey.", + "data": { + "null": null + }, + "template": "\"{{^null}}This should be rendered.{{/null}}\"", + "expected": "\"This should be rendered.\"" + }, + { "name": "Context", "desc": "Objects and hashes should behave like truthy values.", "data": { diff --git a/specs/inverted.yml b/specs/inverted.yml index 5f8e2b2..148b3f5 100644 --- a/specs/inverted.yml +++ b/specs/inverted.yml @@ -46,6 +46,12 @@ tests: template: '"{{^boolean}}This should not be rendered.{{/boolean}}"' expected: '""' + - name: Null is falsey + desc: Null is falsey. + data: { "null": null } + template: '"{{^null}}This should be rendered.{{/null}}"' + expected: '"This should be rendered."' + - name: Context desc: Objects and hashes should behave like truthy values. data: { context: { name: 'Joe' } } diff --git a/specs/sections.json b/specs/sections.json index 73eb2a4..3acc414 100644 --- a/specs/sections.json +++ b/specs/sections.json @@ -21,6 +21,15 @@ "expected": "\"\"" }, { + "name": "Null is falsey", + "desc": "Null is falsey.", + "data": { + "null": null + }, + "template": "\"{{#null}}This should not be rendered.{{/null}}\"", + "expected": "\"\"" + }, + { "name": "Context", "desc": "Objects and hashes should be pushed onto the context stack.", "data": { diff --git a/specs/sections.yml b/specs/sections.yml index 40021c0..fdfd799 100644 --- a/specs/sections.yml +++ b/specs/sections.yml @@ -47,6 +47,12 @@ tests: template: '"{{#boolean}}This should not be rendered.{{/boolean}}"' expected: '""' + - name: Null is falsey + desc: Null is falsey. + data: { "null": null } + template: '"{{#null}}This should not be rendered.{{/null}}"' + expected: '""' + - name: Context desc: Objects and hashes should be pushed onto the context stack. data: { context: { name: 'Joe' } } |