Skip to content

Commit

Permalink
Adding test for inverted group variable handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
atheken committed Sep 9, 2015
1 parent 8436d7c commit 03d2eb9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Mustachio.Tests/TemplateFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,22 @@ public void TemplateRendersWithComplextEachPath()
"<li>name 1 and version 1 and has a CEO: Smith</li>" +
"<li>name 2 and version 2 and has a CEO: Smith</li>", result);
}

[Fact]
public void TemplateShouldProcessVariablesInInvertedGroup()
{
var model = new Dictionary<String, object>
{
{ "not_here" , false },
{ "placeholder" , "a placeholder value" }
};

var template = "{{^not_here}}{{../placeholder}}{{/not_here}}";

var result = Parser.Parse(template)(model);

Assert.Equal("a placeholder value", result);

}
}
}

0 comments on commit 03d2eb9

Please sign in to comment.