Marco Vermeulen
unread,Jan 26, 2012, 7:15:53 AM1/26/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Spock Framework - User
Hey guys,
I've been migrating our Grails projects to 2.0. In the process, most
of my pain seemed to be in migrating the spock integration specs.
My problems stem from the fact that my GORM fixtures aren't being
cleaned up after each test method. Where this really surfaced most was
in the scenarios where my domain objects had an assigned id. my setup
method would try creating a new instance of the domain class, and
would blow up with a unique constraint violation on the id field.
I've even noticed that fixture isn't cleaned up between multiple
integration specs, causing all sorts of funky interactions. One spec's
fixture will cause constraint violations in another fixtures
construction.
To take it yet another step further (haha, yes there is more!), is
when you run tests in the interactive console. The fixture seems to be
kept alive between multiple test runs from the cli.
Is there something that can be done (besides implementing lengthy
cleanup methods on each spec) to clear out the fixture between test
runs?
Cheers,
Marco.