13 Jul 2004 15:15
Re: [groovy-dev] Bruce Eckel's talk & easier unit testing...
On 13 Jul 2004, at 12:43, Laforge Guillaume wrote: >> <at> extends GroovyTestCase > > I'd like very much annotations in Groovy, and moreover, I'd love to > have AST macros (not simple text macros à la C). But perhaps it's > overkill for just creating unit tests with two lines and two curlys > less. Agreed - but its the easiest way I can think of to avoid the class/method cruft >> foo = new Foo() >> foo.doSomething() >> assert foo.bar == 123 > > We could simply add a new tool .sh/.bat to the tool chain which would > be a GUnit runner. > > GUnit MyTest.groovy > > It would recognize both forms: classes or scripts. BTW if we aliased GUnit -> java groovy.util.GroovyTestSuite <arguments> then it'd work today :) >> I guess we're used to stuff like the above, but it would help us >> create >> little testing scripts quicker & easier if we didn't have to wrap >> things in a class/method just to please the JUnit runner > > And btw, for such simple tests, it could certainly be run inside an > IDE. > You would either have a sandbox console, or simply select some code, > and right-click on "Run selection as Unit test". Yep. I can run scripts as unit tests today in IDEA by running groovy.util.GroovyTestSuite with the system property 'test' pointing to the real script to test. Though a better plugin to hide this detail would really help :) James ------- http://radio.weblogs.com/0112098/
RSS Feed