Skip to content

Commit 7cc3360

Browse files
committed
build: fix yaml upgrade
1 parent 4007ad8 commit 7cc3360

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

handlebars/src/main/java/com/github/jknack/handlebars/helper/StringHelpers.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,8 @@ protected CharSequence safeApply(final Object context, final Options options) {
503503
* </p>
504504
*
505505
* <pre>
506-
* {{dateFormat date ["format"] [format="format"][locale="locale"][tz=timeZone|timeZoneId][time="format"]}}
506+
* {{dateFormat date ["format"] [format="format"][locale="locale"][tz=timeZone|timeZoneId]
507+
* [time="format"]}}
507508
* </pre>
508509
*
509510
* Format parameters is one of:
@@ -527,7 +528,8 @@ protected CharSequence safeApply(final Object context, final Options options) {
527528
* It defaults to the system time zone.
528529
* </li>
529530
* <li>
530-
* The "time" parameter specifies the format of the time part, it can be "full", "long", "medium" or "short".
531+
* The "time" parameter specifies the format of the time part, it can be "full", "long",
532+
* "medium" or "short".
531533
* If you do not specify it only the date part will appear in the output string.
532534
* </li>
533535
* </ul>

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void shouldCompileTo(final String template, final String context,
3333
final String expected, final String message) throws IOException {
3434
Object deserializedContext = context;
3535
if (deserializedContext != null) {
36-
deserializedContext = new Yaml().load(context);
36+
deserializedContext = parseYaml(context);
3737
}
3838
shouldCompileTo(template, deserializedContext, expected, message);
3939
}
@@ -50,12 +50,16 @@ public void shouldCompileTo(final String template, final Object context,
5050

5151
public void shouldCompileTo(final String template, final String context,
5252
final Hash helpers, final String expected) throws IOException {
53-
shouldCompileTo(template, new Yaml().load(context), helpers, expected, "");
53+
shouldCompileTo(template, parseYaml(context), helpers, expected, "");
54+
}
55+
56+
private Object parseYaml(String context) {
57+
return new Yaml().load(context);
5458
}
5559

5660
public void shouldCompileTo(final String template, final String context,
5761
final Hash helpers, final String expected, final String message) throws IOException {
58-
shouldCompileTo(template, new Yaml().load(context), helpers, expected, message);
62+
shouldCompileTo(template, parseYaml(context), helpers, expected, message);
5963
}
6064

6165
public void shouldCompileTo(final String template, final Object context,

0 commit comments

Comments
 (0)