Invertable -> invertible. Other minor tidying.

This commit is contained in:
Michael Bayne
2014-03-11 07:43:44 -07:00
parent 2251ac1ed2
commit 59e06b24c9
3 changed files with 25 additions and 31 deletions
@@ -629,30 +629,24 @@ public class MustacheTest
}));
}
@Test public void testInvertableLambda () {
@Test public void testInvertibleLambda () {
test("positive = positive, negative = negative, simple lambdas do still work",
"{{#invertable}}positive{{/invertable}}, {{^invertable}}negative{{/invertable}}, simple lambdas do {{^simple}}NOT {{/simple}}still work",
context("invertable", new Mustache.InvertableLambda() {
@Override
public void execute(Template.Fragment frag, Writer out)
throws IOException {
out.write("positive = ");
frag.execute(out);
}
@Override
public void executeInverse(Template.Fragment frag, Writer out)
throws IOException {
out.write("negative = ");
frag.execute(out);
}
}, "simple", new Mustache.Lambda() {
@Override
public void execute(Template.Fragment frag, Writer out)
throws IOException {
frag.execute(out);
}
}));
"{{#invertible}}positive{{/invertible}}, {{^invertible}}negative{{/invertible}}, " +
"simple lambdas do {{^simple}}NOT {{/simple}}still work",
context("invertible", new Mustache.InvertibleLambda() {
public void execute (Template.Fragment frag, Writer out) throws IOException {
out.write("positive = ");
frag.execute(out);
}
public void executeInverse (Template.Fragment frag, Writer out) throws IOException {
out.write("negative = ");
frag.execute(out);
}
}, "simple", new Mustache.Lambda() {
public void execute (Template.Fragment frag, Writer out) throws IOException {
frag.execute(out);
}
}));
}
@Test public void testNonStandardDefaultDelims () {