Open GoogleCodeExporter opened 8 years ago
I agree that this will be a killer feature. We've wanted to have it for a long
time. Any volunteers to implement it? :-)
Original comment by pnied...@gmail.com
on 13 Dec 2011 at 7:38
Original comment by pnied...@gmail.com
on 17 Feb 2012 at 3:04
Original comment by pnied...@gmail.com
on 4 Oct 2012 at 6:46
Try grails.test.mixin.TestMixin
Code will be:
@TestMixin(SpecMixin)
class RealSpec extends Specification {
def objectUnderTest = new ObjectUnderTest()
}
Original comment by karsten....@gmail.com
on 7 Nov 2013 at 4:21
This issue is about a general solution for Spock, not a Grails-specific one.
Original comment by pnied...@gmail.com
on 7 Nov 2013 at 4:27
I have tried to provide a setup/setupSpec method through a Groovy Mixin. While
I can provide certain behaviour through inheritance, it turns out to be a bit
limited when various categories of tests (integration, unit test, ...) require
a very different test setup. Essentially the class tree will "explode".
Generally I have experienced that Mixins/Delegates are not very helpful with
Spock specifications. For example I also tried to add a Mixin that provided a
specification with a Spring @Autowired target that was not recognized by
Spring. I assume that is due to the way Mixins are implemented in Groovy?
Original comment by Martin.A...@gmail.com
on 18 Feb 2014 at 8:45
Groovy mixins are only visible to Groovy code, and they never appeared to work
well for me. If I'm not mistaken, there is a way to bring annotations across
when using `@Delegate`. Then again, `@Delegate` might not play well with other
AST transforms, such as Spock's.
Original comment by pnied...@gmail.com
on 20 Feb 2014 at 1:10
Original comment by pnied...@gmail.com
on 1 Mar 2015 at 11:45
Original issue reported on code.google.com by
peter.ri...@gmx.net
on 2 Dec 2011 at 6:16