Thursday, November 19, 2009

Invoke test classes from groovy

Just a quick note, mostly for myself. If a unit test extends GroovyTestCase, it can be run from groovy.

class GroovyTest extends GroovyTestCase {
    void testString {
        assertEquals 'Test failed!', "Test", "Test"
    }
}

To execute this test, run the following command:

$ groovy GroovyTest.groovy
 Time: 0.125
 OK (1 test)

No comments:

Post a Comment