hakandilek / spock

Automatically exported from code.google.com/p/spock
0 stars 0 forks source link

can't use Grails mocking support in setupSpec #114

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The internal fields in UnitSpec are not shared, which prevents certain 
functions working from setupSpec.

Original issue reported on code.google.com by lda...@gmail.com on 28 Jul 2010 at 7:25

GoogleCodeExporter commented 9 years ago

Original comment by pnied...@gmail.com on 11 Aug 2010 at 10:44

GoogleCodeExporter commented 9 years ago

Original comment by lda...@gmail.com on 4 Dec 2010 at 11:53

GoogleCodeExporter commented 9 years ago

Original comment by lda...@gmail.com on 7 Dec 2010 at 12:10

GoogleCodeExporter commented 9 years ago
Still a problem with Grails 2.0?

Original comment by pnied...@gmail.com on 20 Feb 2012 at 12:22

GoogleCodeExporter commented 9 years ago
Not sure if this is still relevant, moving to next milestone.

Original comment by pnied...@gmail.com on 4 Oct 2012 at 6:39

GoogleCodeExporter commented 9 years ago
Still relevant to Grails 2.2.0 and test(":spock:0.7") { exclude 
"spock-grails-support" }

Original comment by fsalexm...@gmail.com on 1 Mar 2013 at 1:33

GoogleCodeExporter commented 9 years ago
Are you saying that you are using UnitSpec together with Grails 2.2? Base 
classes like UnitSpec are only meant for use with Grails 1.x.

Original comment by pnied...@gmail.com on 1 Mar 2013 at 1:54

GoogleCodeExporter commented 9 years ago
That's a surprise for me, it's user all over across our app and it's not marked 
as @Derprecated
How should we mock domain classes in Spock unit-tests then?

Original comment by fsalexm...@gmail.com on 1 Mar 2013 at 1:59

GoogleCodeExporter commented 9 years ago
The classes aren't deprecated because the plugin is designed to work both for 
Grails 1.x and 2.x. From the plugin documentation 
(http://grails.org/plugin/spock):

Unit Testing with Grails 2.0

Grails 2 introduced brand new unit test support based on mixins instead of 
testing super classes. These mixins, are fully compatible with Spock! This 
means that you use exactly the same approach as outlined in the Grails User 
Guide on Unit Testing. You should always extend spock.lang.Specification in 
your spock-grails unit tests, just like regular Spock tests.

Original comment by pnied...@gmail.com on 1 Mar 2013 at 2:02

GoogleCodeExporter commented 9 years ago

Original comment by pnied...@gmail.com on 1 Mar 2015 at 11:45