Skip to content

Commit 25f80ba

Browse files
author
Ilya Brin
committed
add tests against direct context lookup
1 parent 5ed8e52 commit 25f80ba

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

handlebars/src/test/java/com/github/jknack/handlebars/InternalDataTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
import org.junit.Test;
1010

11+
import static org.junit.Assert.assertEquals;
12+
import static org.junit.Assert.assertNull;
13+
1114
public class InternalDataTest extends AbstractTest {
1215

1316
@Override
@@ -34,6 +37,7 @@ protected Object configureContext(final Object model) {
3437
@Test
3538
public void dataAvailableForRendering() throws IOException {
3639
shouldCompileTo("{{foo}}", "", "foo");
40+
assertEquals("foo", ((Context)configureContext("")).get("foo"));
3741
}
3842

3943
@Test
@@ -47,6 +51,7 @@ public void internalDataNotAvailableForRendering() throws IOException {
4751
shouldCompileTo("{{internalData.bar}}", "", "");
4852
shouldCompileTo("{{this.internalData}}", "", "");
4953
shouldCompileTo("{{this.internalData.bar}}", "", "");
54+
assertNull(((Context)configureContext("")).get("bar"));
5055
}
5156

5257
@Test

0 commit comments

Comments
 (0)