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:Sam Carr (samc@mac.com)
Date:Dec 19, 2011 3:00:51 am
List:org.codehaus.grails.user

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.

@TestFor(CashController) @Mock([Dish, CashTransaction]) class CashControllerSpec extends Specification { ...

On 19 Dec 2011, at 10:25, Roshan Dawrani wrote:

Even with 0.6-SNAPSHOT, I am getting the following error. I don't know if it is
related, but spock-0.6-SNAPSHOT plugin still seems to be pulling in the snapshot
jar - spock-grails-support-0.6-groovy-1.8-SNAPSHOT.jar

Which framework adds mockDomain(Class) to the class under test - Grails or
Spock? Wondering where does the inconsistency lie.

--------------------------------------------------------------------------------- The return type of java.lang.Object mockDomain(java.lang.Class) in ClientSpec is
incompatible with void mockDomain(java.lang.Class) in
grails.plugin.spock.UnitSpec . At [-1:-1] @ line 8, column 1. class ClientSpec extends UnitSpec

---------------------------------------------------------------------------------

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

On 19/12/2011, at 10:06 AM, Roshan Dawrani wrote:

Hi,

I am looking into Grails 1.3.7 to 2.0 upgrade and some Spock tests are failing
to compile with errors like below:

--------------------------------------------------------------------------------------------------------------------------------------------------- ClientSpec.groovy: 8: 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 . At [-1:-1] @ line 8, column 1. class ClientSpec extends UnitSpec

---------------------------------------------------------------------------------------------------------------------------------------------------

I am currently using org.spockframework:spock:0.6-groovy-1.8-SNAPSHOT plugin,
which pulls in spock-grails-support-0.6-groovy-1.8-SNAPSHOT.jar

Is this the correct version of plugin to use with Grails 2.0? Any hints on why I
am getting the above mentioned error?

You should be using “0.6-SNAPSHOT” as the version of the plugin.