File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ class JavaMustache extends MustacheAPI{
7171 def render (template : String , data : Any ): Html = {
7272 Logger (" mustache" ).debug(" Mustache render template " + template)
7373
74- var mustache = {
74+ val mustache = {
7575 if (Play .isProd) {
7676 val maybeTemplate = mf.compile(template)
7777 if (maybeTemplate == null ) {
Original file line number Diff line number Diff line change @@ -24,8 +24,15 @@ class BasicTestSpec extends Specification {
2424 val params = Map (' title -> " Title" )
2525 val htmlRes = Mustache .render(" title" , params)
2626 htmlRes.toString.equals(" <h3>Title</h3>" )
27+ }
28+
29+ " compile with option parameters" in new WithApplication {
30+ val params = Map (' title -> Some (" Title" ))
31+ val htmlRes = Mustache .render(" title" , params)
32+ htmlRes.toString.equals(" <h3>Title</h3>" )
2733 }
2834
35+
2936 " wrong template" in new WithApplication {
3037 Mustache .render(" title-wrong" , Header (" Title" )) must throwA[Exception ]
3138 }
@@ -41,6 +48,5 @@ class BasicTestSpec extends Specification {
4148
4249 Mustache .render(" content_partial_item" , content).toString must contain(" alice" )
4350 }
44- }
45-
51+ }
4652}
You can’t perform that action at this time.
0 commit comments