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 8:32:58 am
List:org.codehaus.grails.user
Attachments:
grails2-spock-unittest-issue.zip - 156k

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

It's here: https://github.com/spockframework/spock-grails

Anyway, the link I see in Grails 2.0 is:

1) _GrailsTest.groovy.compileTests() chooses to use extended compiler 'testc' (GrailsTestCompiler) for unit tests classes.

2) GrailsTestCompiler injects a ASTTransformationCustomizer for TestFor

3) Because of the ASTTransformationCustomizer added in 2), Groovy now

introduces TestForTransformation for all unit test classes, which in turn weaves in methods from DomainClassUnitTestMixin into the unit test classes.

In this chain, what do you see that can be local to a particular

environment? I can look more, if you can provide a hint.

Looked at your tests for spock-grails plugin.

The difference is that you use gradle based build for it. So (refer 1-3 above), _GrailsTest.groovy does not come into the picture as it does when "grails test-app unit:" is done. That's why GrailsTestCompiler and then weaving of DomainClassUnitTestMixin also does not come into the picture for your tests. So, it's all clean.

I am attaching an almost blank grails application created with Grails 2.0.0.

All I did was:

a) create an app b) add a dependency to plugin ':spock:0.6-SNAPSHOT' c) grails create-domain-class book d) grails test-app unit: -> *this now fails to compile BookSpec added in 3) due to the very same error that I have been reporting and explaining :-)*

Cheers.