File tree Expand file tree Collapse file tree 2 files changed +34
-3
lines changed
main/java/com/github/jknack/handlebars
test/java/com/github/jknack/handlebars/issues Expand file tree Collapse file tree 2 files changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -1254,7 +1254,8 @@ public Handlebars parentScopeResolution(final boolean parentScopeResolution) {
12541254 * <pre>
12551255 * {{> @partial-block}}
12561256 * </pre>
1257- * Attention: If this is set to true, Handlebars works *much* slower!
1257+ * Attention: If this is set to true, Handlebars works *much* slower! while rendering
1258+ * partial blocks. Default is: true for compatibility reasons.
12581259 *
12591260 * @return If true partial blocks will be evaluated before the partial will be rendered
12601261 * to allow inline block side effects.
@@ -1271,7 +1272,8 @@ public boolean preEvaluatePartialBlocks() {
12711272 * <pre>
12721273 * {{> @partial-block}}
12731274 * </pre>
1274- * Attention: If this is set to true, Handlebars works *much* slower!
1275+ * Attention: If this is set to true, Handlebars works *much* slower! while rendering
1276+ * partial blocks. Default is: true for compatibility reasons.
12751277 *
12761278 * @param preEvaluatePartialBlocks If true partial blocks will be evaluated before the
12771279 * partial will be rendered to allow inline block side
@@ -1290,7 +1292,8 @@ public void setPreEvaluatePartialBlocks(final boolean preEvaluatePartialBlocks)
12901292 * <pre>
12911293 * {{> @partial-block}}
12921294 * </pre>
1293- * Attention: If this is set to true, Handlebars works *much* slower!
1295+ * Attention: If this is set to true, Handlebars works *much* slower! while rendering
1296+ * partial blocks. Default is: true for compatibility reasons.
12941297 *
12951298 * @param preEvaluatePartialBlocks If true partial blocks will be evaluated before the
12961299 * partial will be rendered to allow inline block side
Original file line number Diff line number Diff line change 1+ package com .github .jknack .handlebars .issues ;
2+
3+ import com .github .jknack .handlebars .HandlebarsException ;
4+ import com .github .jknack .handlebars .v4Test ;
5+ import static org .junit .Assert .assertTrue ;
6+ import static org .junit .Assert .fail ;
7+ import org .junit .Test ;
8+
9+ public class Issue634 extends v4Test {
10+
11+ @ Test
12+ public void shouldThrowHandlebarsExceptionWhenPartialBlockIsMissing () throws Exception {
13+ try {
14+ shouldCompileTo ("{{> my-partial}}" ,
15+ $ ("partials" , $ ("my-partial" , "Hello {{> @partial-block}}" )), null );
16+ fail ("Must throw HandlebarsException" );
17+ } catch (HandlebarsException x ) {
18+ assertTrue (x .getMessage ().contains ("does not provide a @partial-block" ));
19+ }
20+ }
21+
22+ @ Test
23+ public void shouldNotThrowHandlebarsException () throws Exception {
24+ shouldCompileTo ("{{#> my-partial}}634{{/my-partial}}" ,
25+ $ ("partials" , $ ("my-partial" , "Hello {{> @partial-block}}" )), "Hello 634" );
26+ }
27+
28+ }
You can’t perform that action at this time.
0 commit comments