atom feed20 messages in org.codehaus.grails.userRe: [grails-user] which spock plugin ...
FromSent OnAttachments
Roshan DawraniDec 19, 2011 2:05 am 
Roshan DawraniDec 19, 2011 2:24 am 
ld...@ldaley.comDec 19, 2011 2:46 am 
Roshan DawraniDec 19, 2011 2:52 am 
ld...@ldaley.comDec 19, 2011 2:55 am 
Sam CarrDec 19, 2011 3:00 am 
Roshan DawraniDec 19, 2011 3:10 am 
Roshan DawraniDec 19, 2011 3:13 am 
Roshan DawraniDec 19, 2011 3:35 am 
Roshan DawraniDec 19, 2011 4:32 am 
Roshan DawraniDec 19, 2011 4:47 am 
Roshan DawraniDec 19, 2011 5:03 am 
Roshan DawraniDec 19, 2011 5:12 am 
Roshan DawraniDec 19, 2011 5:50 am 
Roshan DawraniDec 19, 2011 7:24 am 
Roshan DawraniDec 19, 2011 7:38 am 
Roshan DawraniDec 19, 2011 8:32 am.zip
ld...@ldaley.comDec 20, 2011 9:06 am 
Roshan DawraniDec 21, 2011 11:33 am 
Luke DaleyDec 21, 2011 11:46 am 
Subject:Re: [grails-user] which spock plugin to use with Grails 2.0?
From:Roshan Dawrani (rosh@gmail.com)
Date:Dec 19, 2011 4:32:39 am
List:org.codehaus.grails.user

On Mon, Dec 19, 2011 at 5:20 PM, Luke Daley <lda@gmail.com> wrote:

Is it Grails that normally adds mockDomain(Class), mockDomain(Class, List) to classes under test? I would have liked looking at that transform, etc to see if it is adding a method with return type not void, but Object.

There shouldn't be any transforms kicking in. I can't think of what would be unique about your project, because this definitely works for others.

See if you can reproduce in a small isolated project and share it, if I can poke at it it might make the process quicker.

Hi Luke,

I poked around a bit. The mockDomain() methods are added to ClientSpec by GrailsASTUtils.addDelegateInstanceMethods(...) - via TestMixinTransformation.weaveMixinsIntoClass()

Regarding Groovy's verifier rejecting the ClientSpec with "*The return type of java.lang.Object mockDomain(java.lang.Class) in foo.Spec is incompatible with void mockDomain(java.lang.Class) in grails.plugin.spock.UnitSpec*" ->

- the reason is that we also use Groovy++ in our Grails application and there is an additional Verifier visit Groovy++ performs for its own thing. That early Verifier visit is resulting in this issue. So, it's an issue with Grails 2.0 / Groovy 1.8.4 + Groovy++ marriage. That's why you don't commonly see this issue elsewhere. Not a Grails issue, but something between Groovy++ and Groovy 1.8.4. Will ask around more there.