use of com.squarespace.template.CodeExecuteException in project template-compiler by Squarespace.
the class CoreFormattersTest method testApplyPartialMissing.
@Test
public void testApplyPartialMissing() throws CodeException {
String template = "{@|apply foo}";
String partials = "{\"block\": \"hello\"}";
String input = "{}";
Instruction inst = compiler().compile(template).code();
Context ctx = new Context(JsonUtils.decode(input));
ctx.setCompiler(compiler());
ctx.setPartials(JsonUtils.decode(partials));
try {
ctx.execute(inst);
fail("Expected exception");
} catch (CodeExecuteException e) {
assertEquals(e.getErrorInfo().getType(), APPLY_PARTIAL_MISSING);
}
}
Aggregations