From 1e8c2bcda2a509afd56b3dd7a1f9479db2bd0e88 Mon Sep 17 00:00:00 2001 From: Tomek Wiszniewski Date: Mon, 31 Aug 2015 10:34:17 +0200 Subject: [PATCH] Add spec for leading dot Fixes https://github.com/mustache/spec/issues/52 --- specs/interpolation.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/specs/interpolation.yml b/specs/interpolation.yml index 1b6fff1..d08e219 100644 --- a/specs/interpolation.yml +++ b/specs/interpolation.yml @@ -171,6 +171,15 @@ tests: template: '"{{#a}}{{b.c.d.e.name}}{{/a}}" == "Phil"' expected: '"Phil" == "Phil"' + - name: Dotted Names - Leading Dot + desc: A leading dot should force resolution inside the current scope. + data: + a: { } + b: { name: 'Name' } + name: 'Fail' + template: '{{#a}}{{.name}}{{/a}}{{#b}}{{.name}}{{/b}}' + expected: 'Name' + - name: Dotted Names - Context Precedence desc: Dotted names should be resolved against former resolutions. data: