So, as promised, I've created a "test-template" plugin that will
1) Generate controller unit test cases automatically when you generate
scaffolded controllers (provided you're using Grails 1.0.4)
2) Stub out a unit test case for a given domain class (no, it doesn't
write the test code for you (yet), but it does create several test
methods for you to fill in)
Check out the details at
http://www.piragua.com/2008/11/16/added-generate-unit-test-case-script-to-test-template-plugin/
or
http://www.grails.org/TestTemplate+Plugin
It even has cool things like support for packages (you are using
packages in your grails apps, right?) and the 'uber-generate' feature
of Grails 1.0.4 (create a bunch of domain classes and then run grails
generate-all "*" and grails generate-domain-unit-test "*" - c'mon, I
dare you).
You can install it by running:
grails install-plugin testing
grails install-plugin test-template
(the first line is required because the test-template plugin relies on
the testing plugin. if you already have the testing plugin installed
you don't need to run that one first).
Happy testing,
Mike
On Nov 11, 8:41 pm, Mike Hugo <
m...@piragua.com> wrote:
> No problem Ted, glad to hear it'll be helpful. The "one more thing"
> is the beginnings of a plugin I'm thinking about that would 1)
> generate tests for generated scaffolding in controllers and 2) stub
> out constraints tests for a domain object.
>
> Part 1 (albeit not in plugin form yet) is done already -
> checkouthttp://
github.com/mjhugo/bookstore/tree/master
> >>> ps- here are some of the posts about the plugin from the ML:
http://www.nabble.com/-ANN--Experimental-testing-plugin-td18530858.ht...
> >>> ...