EDIT: 2/15/2013: Scratch this way of doing it. I didn’t fully understand how requirejs worked in tests when I wrote this. You should instead just be using a define around your tests, which should work very similarly to the rest … Continued
unit testing
Unit Testing Grails Services that use Redis Without Stomping on Data
The Grails Redis plugin lets you use Redis as a store for all kinds of data. I find it especially useful as a compliment to a primary datastore. I use Redis for it’s caching and set operation strengths and let … Continued
Fixing Grails Tests That Pass in Isolation but Fail When Run as a Suite
If you’ve got a test that passes when run by itself but fails when run with the rest of the tests in your test suite, you’ve almost definitely got a test pollution problem. Test pollution happens when the results of … Continued
Upgrading to Grails 2 Unit Testing
Grails 2 has a lot of great new unit testing features that make many test scenarios easier. The grails documentation does an OK job of describing some of the new features, but there really wasn’t anywhere that I could find … Continued
Creating New Instances of Spring “Singleton” Beans with Grails BeanBuilder
When I’m integration testing Grails service classes, I often want to mock off a part of the class so that a complicated code branch isn’t followed that I’m not trying to test. Grails will helpfully inject fully autowired Spring service … Continued