dewarim / LittleGoblin

A browser game framework written in Grails
Other
10 stars 2 forks source link

Move unit tests to TestService #102

Closed dewarim closed 9 years ago

dewarim commented 9 years ago

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.

dewarim commented 9 years ago

see: 8c896ef17

dewarim commented 9 years ago

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.