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.
A collection of articles and resources of interest to the modern software developer
Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work. And the only way to do great work is to love what you do.
-- Steve Jobs
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
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment