You should be using “0.6-SNAPSHOT” as the version of the plugin.
--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To post to this group, send email to spockfr...@googlegroups.com.
To unsubscribe from this group, send email to spockframewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.
Is the new Grails 2 test mixing a must?No, can you share all of ClientSpec.groovy ?
Note that your Spock tests should subclass Specification, not UnitSpec with Grails 2. Then you should use the @TestFor and @Mock annotations to hook into Grails' new test support. So a controller unit test might start as below. See the Grails 2.0 testing docs for more information.
It seems like you have a version of ClientSpec floating around that has been compiled with something else.Long shot, but try a full clean build (i.e. grails clean & rm -rf ~/.grails/2.0.0/projects/«project»)
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.
Not a Grails issue, but something between Groovy++ and Groovy 1.8.4. Will ask around more there.
Is DomainClassUnitTestMixin being applied implicitly?
I have local tests that I would expect to hit this if it were being added automatically to every class. I doubt that it would be as that's very dangerous.Could there be something else in your environment that is triggering this?
> On Mon, Dec 19, 2011 at 8:19 PM, Luke Daley <lda...@gmail.com> wrote:
> I have local tests that I would expect to hit this if it were being added automatically to every class. I doubt that it would be as that's very dangerous.
>
> Could there be something else in your environment that is triggering this?
>
> As far as I see at this point, it's not related specifically to my environment now. I wish I could see what your local tests cover - to compare and see why they are not hitting this issue. Just to cross-check once more - you have local Spock tests that do not extend UnitSpec, but do not use @TestFor?
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.
Didn't you say you had Groovy++ in the mix?
It's here: https://github.com/spockframework/spock-grails
Didn't you say you had Groovy++ in the mix?
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.
Fixed.
I can't see anything, I'm stumped.
> That's why GrailsTestCompiler and then weaving of DomainClassUnitTestMixin also does not come into the picture for your tests. So, it's all clean.
That's not the case, the Gradle build is delegating to the Grails build system so they are compiled the same way. I'm at a a loss to explain why these tests pass.