Tuesday, August 2, 2011

Groovy MetaClass Magic in Unit Tests | Jworks.nl - Agile Software Development

Groovy MetaClass Magic in Unit Tests | Jworks.nl - Agile Software Development
As you may or may not know, Groovy has the concept of MetaClasses. MetaClasses enable you to add or change methods at runtime. This is especially handy when doing some mocking during a unit test (or, in our case, GrailsUnitTestCases). By mocking methods, you can mock out certain dependencies or behavior which you might not want during a unit test.

No comments:

Post a Comment