Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 2.0 final
-
Component/s: Configuration
-
Labels:None
Description
there are two scenarios i'm thinking of:
(1) grails.gorm.failOnError = true
can't really simulate this in unit test, so basically requires consistent (and redundant) <domain instance>.save(failOnError: true) to make unit tests consistent with app at runtime, which eliminates the benefit of that setting.
see this thread for reference: http://grails.1312388.n4.nabble.com/unit-testing-grails-gorm-failOnError-true-td4231435.html
(2) logging
sometimes unit tests fail and sometimes log output can be a huge benefit in tracking down the issue.
the now defunct 'mockLogging(class, enableDebug=true)' attempted to address this, but is no longer in play in 2.x+
see this thread for reference: http://grails.1312388.n4.nabble.com/grails-2-0-0-RC1-mockLogging-td3993095.html
------------
on one level w.r.t. the 'dry' principal it would be cool to have unit tests 'honor' config.groovy, but i'm sure it's not that simple, so i'll leave solutioning to the experts ![]()
Logging should now appear in standard out of unit test reports for Grails 2.0.1