Unit testing with GORM in Grails suffers from "too much magic" - sometimes objects are persisted to the in-memory database, sometimes they are missing, etc - it's taking far, far too long to write even the simplest working tests.
Just now I had a broken test which would fail at about 30% chance. If it would always fail, ok, I can code my way around this. But this is simply unworkable.
New strategy is to run unit tests depending on configuration on Bootstrap. Not quite as nice, but at least it works.
Fixed current test classes which extend Specification. No need to move them as they are now working. And a working test with mocks is better than no test.
Unit testing with GORM in Grails suffers from "too much magic" - sometimes objects are persisted to the in-memory database, sometimes they are missing, etc - it's taking far, far too long to write even the simplest working tests. Just now I had a broken test which would fail at about 30% chance. If it would always fail, ok, I can code my way around this. But this is simply unworkable. New strategy is to run unit tests depending on configuration on Bootstrap. Not quite as nice, but at least it works.