| From | Sent On | Attachments |
|---|---|---|
| Roshan Dawrani | Dec 19, 2011 2:05 am | |
| Roshan Dawrani | Dec 19, 2011 2:24 am | |
| ld...@ldaley.com | Dec 19, 2011 2:46 am | |
| Roshan Dawrani | Dec 19, 2011 2:52 am | |
| ld...@ldaley.com | Dec 19, 2011 2:55 am | |
| Sam Carr | Dec 19, 2011 3:00 am | |
| Roshan Dawrani | Dec 19, 2011 3:10 am | |
| Roshan Dawrani | Dec 19, 2011 3:13 am | |
| Roshan Dawrani | Dec 19, 2011 3:35 am | |
| Roshan Dawrani | Dec 19, 2011 4:32 am | |
| Roshan Dawrani | Dec 19, 2011 4:47 am | |
| Roshan Dawrani | Dec 19, 2011 5:03 am | |
| Roshan Dawrani | Dec 19, 2011 5:12 am | |
| Roshan Dawrani | Dec 19, 2011 5:50 am | |
| Roshan Dawrani | Dec 19, 2011 7:24 am | |
| Roshan Dawrani | Dec 19, 2011 7:38 am | |
| Roshan Dawrani | Dec 19, 2011 8:32 am | .zip |
| ld...@ldaley.com | Dec 20, 2011 9:06 am | |
| Roshan Dawrani | Dec 21, 2011 11:33 am | |
| Luke Daley | Dec 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 21, 2011 11:33:54 am | |
| List: | org.codehaus.grails.user | |
On Tue, Dec 20, 2011 at 10:36 PM, ld...@ldaley.com <ld...@ldaley.com> wrote:
Fixed.
Thanks. Will verify soon with our app.
I can't see anything, I'm stumped.
I found why. Details below :-)
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.
Went nearly crazy debugging through Grails 2.0 + Gradle + Groovy 1.8.4 + grails-gradle-plugin + grails-launcher + spock-grails plugins, and here is the simple difference between my application and your spock-grails with tests:
- In my app, for a unit test like AndroidClientSpec, I have a domain class AndroidClient. In your app, for unit tests like UnitSpecSpec, GoodSpec, there are no corresponding classes UnitSpec or Good
- The way Grails 2.0 TestForTransformation works is that it auto-magically applies @TestFor and weaves all its mock / mixin stuff to a unit test only if for FooTests or FooSpec unit test, it finds a Foo artefact.
So, if you want to cover this auto-magic mixing of old style unit tests (that extend UnitSpec) in your spock-grails test application, then you need to introduce a correspnding artefact (domain class, say), and you should see that then Grails 2.0 will then weave stuff into that test, while skipping other tests that don't have a matching class to test / mock for.
Cheers.
-- Roshan http://roshandawrani.wordpress.com/






.zip