The partial mocking is performed simply by using the mock method on your concrete object. Here is how it works with a grails controller:def controller = new SomeController()mock(controller).params.returns = [id: 3]

GMock 0.7.0 is the last release compatible with Groovy 1.5.x. Support for Groovy 1.6.0 is coming soon.

Tuesday, 3 March 2009

Gsp reloading does not happen on environments other than development. To get around this you can either pass in a command line argument of -Dgrails.gsp.enable.reload=true or put grails.gsp.enable.reload=true into the environment config for the environment that you want gsp reloading.

This came to light because we do not use production data in our development environment but sometimes it's useful to have production data to test with or to work out a bug. We have a separate environment config for the times we want to run with prod data so this little flag has become a life-saver.

The command to run tests is grails run-selenium. The script now runs in the test environment by default so you no longer need to use grails test run-selenium.

You may need to configure the browser Selenium uses. To do so edit test/selenium/selenese/conf/SeleniumConfig.groovy and set the selenium.browser property. For some reason Firefox 3 needs to be specified as *chrome. For example on a Mac I have to use the setting