Testing of Gaelyk app that uses plugins

9 views
Skip to first unread message

mmigdol

unread,
Sep 19, 2012, 11:11:42 AM9/19/12
to gae...@googlegroups.com
Hello,

I am trying to write some Spock tests for an app.  The app uses the JSONlib plugin.  However, it appears that in the Gaelyk test environment, the plugin's JsonLibCategory is not being applied.  i.e. when my Groovlet under test executes:

    response.renderJson(foo)

the test is throwing a MissingMethodException for renderJson.

Am I supposed to have to put my test's call to get() inside a with() block to overcome this?  Or is this happening because Mock(HttpServletResponse) does not inherit the categories applied to HttpServletResponse?

Thanks in advance,
Michael

mmigdol

unread,
Sep 19, 2012, 11:12:45 AM9/19/12
to gae...@googlegroups.com
Sorry, I meant a "use" block, not a "with" block...

Vladimír Oraný

unread,
Sep 20, 2012, 2:19:44 AM9/20/12
to gae...@googlegroups.com
Hi Michael,

you have annotate your test methods (or classes) with @spock.util.mop.Use(JsonLibCategory) annotation.

Cheers,
Vladimir

2012/9/19 mmigdol <mmi...@gmail.com>
--
You've received this message because you've subscribed to the Gaelyk Google Group.
To send an email to the group, please write to: gae...@googlegroups.com
To unsuscribe from this group: gaelyk+un...@googlegroups.com
To show more options: http://groups.google.fr/group/gaelyk?hl=en

Reply all
Reply to author
Forward
0 new messages