@@ -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