[ANN] Spock 0.7 Released

2,598 views
Skip to first unread message

Peter Niederwieser

unread,
Oct 9, 2012, 12:12:29 AM10/9/12
to spockfr...@googlegroups.com
Dear Spock Community,

I'm pleased to announce that Spock 0.7 has been released. As usual, it is available from Maven Central (http://repo1.maven.org/maven2/org/spockframework).

All Spock 0.7 Jars come in two variants: `-groovy-1.8` for Groovy 1.8.x, and `-groovy-2.0` for Groovy 2.x. Please make sure to use the variant that's right for you. If you aren't tied to a particular Groovy version, we recommend that you use the Groovy 2.x variant.

The highlights of this release are:

 * New reference documentation
 * Much improved stubbing and mocking
 * Official Groovy 2.x support


An updated Grails plugin will follow within the next few days at the usual place (http://grails.org/plugin/spock).

We would love to get your feedback on this release. If you have anything to say, please reach out to us on http://forum.spockframework.org. In particular, we would like to hear how the new Groovy mocking features work out for our Grails users.

One more thing: The next release is going to be 1.0! The highest priority for 1.0 is to complete the reference documentation.

Cheers,
Peter

pangea

unread,
Oct 9, 2012, 10:34:16 PM10/9/12
to spockfr...@googlegroups.com
Congratulations. The best thing that can happen for 1.0 release is the business friendly reporting. We have 1200 + acceptance tests written using Spock and not able to have a business friendly report is not enabling the business folks to contribute. Pleaseeeeee add this feature.

Paul

unread,
Oct 9, 2012, 11:57:05 PM10/9/12
to spockfr...@googlegroups.com
All of our unit and integration tests worked perfectly with the latest version. However, our geb-spock tests failed to compile with Maven and eclipse with the following error:
The type org.spockframework.mock.MockController cannot be resolved. It is indirectly referenced from required .class files

I tried with the groovy 2.0 version. We are using geb-spoc 0.7.2. Is this something I should report to the geb team?

Thank you.

Peter Niederwieser

unread,
Oct 10, 2012, 2:22:03 AM10/10/12
to spockfr...@googlegroups.com
This will be fixed once geb-spock releases a new version compiled against Spock 0.7. I'll let them know. Hopefully, we'll find a way to avoid this tight coupling by the time Spock goes 1.0.

Cheers,
Peter

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To view this discussion on the web visit https://groups.google.com/d/msg/spockframework/-/N-2ABCpjiSoJ.
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.

Peter Niederwieser

unread,
Oct 10, 2012, 2:26:00 AM10/10/12
to spockfr...@googlegroups.com
Have you tried any of the third-party extensions?

https://github.com/damage-control/report
https://github.com/chanwit/spock-report-html

On Oct 9, 2012, at 9:34 PM, pangea <yara...@gmail.com> wrote:

> Congratulations. The best thing that can happen for 1.0 release is the business friendly reporting. We have 1200 + acceptance tests written using Spock and not able to have a business friendly report is not enabling the business folks to contribute. Pleaseeeeee add this feature.
>
> --
> You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/spockframework/-/ZpICCj7U448J.

Brice Ruth

unread,
Oct 10, 2012, 9:12:47 AM10/10/12
to spockfr...@googlegroups.com
Is there any documentation (or a blog post) on how to use damage-control/report?
--
Brice D. Ruth
Sr. Advisor - Software Engineering
C. 608-628-4625
E. br...@flexion.us
FLEXION - VALUE FORWARD
1500 West Main Street, Suite 500
Sun Prairie, WI 53590







Notice: The information contained in this message or any attached document is confidential and intended only for individuals to whom it is addressed. If you got this message in error, please inform me immediately using one of the methods above. In some cases, I may ask you to return the documents at my expense. In general, please simply destroy the information at once. Any unauthorized use, distribution, or copying of this information is prohibited.

Luke Daley

unread,
Oct 10, 2012, 12:41:08 PM10/10/12
to spockfr...@googlegroups.com
I'll have a working Geb version out within 7 days.

Paul

unread,
Oct 10, 2012, 2:13:57 PM10/10/12
to spockfr...@googlegroups.com
Thank you.

pangea

unread,
Oct 14, 2012, 5:27:16 PM10/14/12
to spockfr...@googlegroups.com
Thx will checkout the damage-ontrol

Luke Daley

unread,
Oct 18, 2012, 11:59:03 AM10/18/12
to spockfr...@googlegroups.com




On 18/10/2012, at 11:31 AM, Abhijith Prabhakar <abhi.p...@gmail.com> wrote:

Hi,

I am looking to use Spock 0.7 version on my Grails project.  But, I don't see spock 0.7 grails plugin released.

When can I expect spock 0.7 Grails plugin?

In the coming days. 

I'm actively working on it, but there are some complications.


Thanks,
Abhi

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To view this discussion on the web visit https://groups.google.com/d/msg/spockframework/-/ytGDiQ9ND_gJ.

Paul

unread,
Oct 18, 2012, 1:15:18 PM10/18/12
to spockfr...@googlegroups.com
Could you please give an update on when Geb will work with spock 0.7?

Thank you.

Chanwit Kaewkasi

unread,
Oct 18, 2012, 1:24:07 PM10/18/12
to spockfr...@googlegroups.com
Hi Luke,

Great to know that you've been working on it. Thank you for your hard work.

Could you please also having a test for GroovySpy over Grails domain classes?
I've found that GroovySpy does not work on Grails domain classes, but
it's working fine with normal Java classes, for example, class Java's
Math.

(ps. I've built Spock 0.7 plugin myself and been testing it locally.
This is a problem I've encountered so far.)

Best regards,

-chanwit

--
Chanwit Kaewkasi
twitter.com/chanwit

Luke Daley

unread,
Oct 22, 2012, 4:24:47 PM10/22/12
to spockfr...@googlegroups.com

On 18/10/2012, at 6:24 PM, Chanwit Kaewkasi wrote:

> Hi Luke,
>
> Great to know that you've been working on it. Thank you for your hard work.
>
> Could you please also having a test for GroovySpy over Grails domain classes?
> I've found that GroovySpy does not work on Grails domain classes, but
> it's working fine with normal Java classes, for example, class Java's
> Math.

Can you give more details on this please.

Luke Daley

unread,
Oct 22, 2012, 4:25:18 PM10/22/12
to spockfr...@googlegroups.com

On 18/10/2012, at 6:15 PM, Paul wrote:

> Could you please give an update on when Geb will work with spock 0.7?

All I can say is soon. I'll be working on it this weekend, but may not get it done then.

>
> Thank you.
>
> --
> You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/spockframework/-/cdGIFyPWOIoJ.

Chanwit Kaewkasi

unread,
Oct 23, 2012, 8:39:53 AM10/23/12
to spockfr...@googlegroups.com
Here's steps to reproduce.
1. create a domain class in Grails, say:

class Domain {
static findWithSomething(int id) { return 10 }
}

2. In a Spock's spec, you have a setup clause like this:

setup:
GroovySpy(Domain, global: true)
Domain.findWithSomething(1) >> 20

When you call Domain.findWithSomething(1) it always return 10 (from
the real one), not 20.

This bug does not affect Java classes, say Math. You can partially
mock Math.power() as the Spock's example shows.
So I am guessing that it's only happening when we use Spock under the
Grails environment.

Best regards,

-chanwit

--
Chanwit Kaewkasi
twitter.com/chanwit


Luke Daley

unread,
Oct 23, 2012, 9:42:36 AM10/23/12
to spockfr...@googlegroups.com

On 23/10/2012, at 1:39 PM, Chanwit Kaewkasi wrote:

> Here's steps to reproduce.
> 1. create a domain class in Grails, say:
>
> class Domain {
> static findWithSomething(int id) { return 10 }
> }
>
> 2. In a Spock's spec, you have a setup clause like this:
>
> setup:
> GroovySpy(Domain, global: true)
> Domain.findWithSomething(1) >> 20
>
> When you call Domain.findWithSomething(1) it always return 10 (from
> the real one), not 20.
>
> This bug does not affect Java classes, say Math. You can partially
> mock Math.power() as the Spock's example shows.
> So I am guessing that it's only happening when we use Spock under the
> Grails environment.

This is unlikely to work, because Spock needs a custom meta class to do it's thing and the Grails unit testing support is metaclass based.

You should ask on the Grails list if you can disable the implicit Grails test support mixins so it leaves the metaclass alone.

Paul

unread,
Nov 13, 2012, 11:52:04 AM11/13/12
to spockfr...@googlegroups.com

Hi,
     Just checking in to see if you have any ETA on when geb will be compatible with spock 0.7.


 Thank you.

Luke Daley

unread,
Nov 14, 2012, 11:37:31 AM11/14/12
to spockfr...@googlegroups.com
The just released 0.9.0-RC-1 is compiled against Spock 0.7 (so requires it).

More info: http://markmail.org/message/6atq3jkn6ejo7bpf
> --
> You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/spockframework/-/JBWpcO7SQ8AJ.

Chanwit Kaewkasi

unread,
May 8, 2013, 4:06:26 AM5/8/13
to spockfr...@googlegroups.com
Hi Behrang,

It seems to be a general Grails issue.
Try turning legacyResolve true in your BuildConfig.groovy.

HTH,

-chanwit

--
Chanwit Kaewkasi
linkedin.com/in/chanwit


On Wed, May 8, 2013 at 2:22 PM, Behrang Saeedzadeh <behr...@gmail.com> wrote:
Hi Luke,

Is the MockController issue resolved? I have upgraded our project's spock to 0.7-groovy-2.0, and Geb to 0.9.0-RC-1, but I still get the compilation error.

In particular, here is the relevant parts of our project's config:

grails.project.dependency.resolution = {
    dependencies {
        test "org.spockframework:spock-grails-support:0.7-groovy-2.0"
    }

    plugins {
        test ":geb:0.9.0-RC-1"
        test(":spock:0.7") {
            exclude "spock-grails-support"
        }
    }
}

And here's the error message:

| Error Compilation error compiling [spock] tests: org/spockframework/mock/MockController (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.NoClassDefFoundError: org/spockframework/mock/MockController
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.codehaus.gant.GantBuilder.invokeMethod(GantBuilder.java:99)
at _GrailsTest_groovy$_run_closure3.doCall(_GrailsTest_groovy:266)
at _GrailsTest_groovy$_run_closure2.doCall(_GrailsTest_groovy:245)
at _GrailsTest_groovy$_run_closure1_closure21.doCall(_GrailsTest_groovy:195)
at _GrailsTest_groovy$_run_closure1.doCall(_GrailsTest_groovy:184)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at TestApp$_run_closure1.doCall(TestApp.groovy:82)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:591)
at gant.Gant.executeTargets(Gant.groovy:590)
Caused by: java.lang.ClassNotFoundException: org.spockframework.mock.MockController


Thanks in advance,
Behrang
To unsubscribe from this group and stop receiving emails from it, send an email to spockframewor...@googlegroups.com.

To post to this group, send email to spockfr...@googlegroups.com.

Sebastian Gozin

unread,
May 8, 2013, 4:18:46 AM5/8/13
to spockfr...@googlegroups.com
In my case I was pulling in an old spock-6 dependency through transitive resolution.
Try running grails dependency-report and look for spock-6 and exclude it from the dependency which pulls it in.

To unsubscribe from this group and stop receiving emails from it, send an email to spockframewor...@googlegroups.com.
To post to this group, send email to spockfr...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages