Skip to content

Commit

Permalink
Only unit tests are now created with GrailsUnitTestMixin. Also, the s…
Browse files Browse the repository at this point in the history
…ample test method now has a fail() in it, so running the default tests will result in test failures. We should probably add configuration and command line options for disabling this automatic creation of tests.
  • Loading branch information
pledbrook committed Jun 20, 2011
1 parent 0421754 commit fd9e0d9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
@artifact.package@
import grails.test.mixin.*
import grails.test.mixin.support.*
@artifact.package@import static org.junit.Assert.*
import org.junit.*

/**
* See the API for {@link grails.test.mixin.support.GrailsUnitTestMixin} for usage instructions
*/
@TestMixin(GrailsUnitTestMixin)
class @artifact.name@ {

@Before
Expand All @@ -21,6 +15,6 @@ class @artifact.name@ {

@Test
void testSomething() {

fail "Implement me"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@artifact.package@import static org.junit.Assert.*

import grails.test.mixin.*
import grails.test.mixin.support.*
import org.junit.*

/**
* See the API for {@link grails.test.mixin.support.GrailsUnitTestMixin} for usage instructions
*/
@TestMixin(GrailsUnitTestMixin)
class @artifact.name@ {

@Before
void setUp() {
// Setup logic here
}

@After
void tearDown() {
// Tear down logic here
}

@Test
void testSomething() {
fail "Implement me"
}
}
2 changes: 1 addition & 1 deletion grails-scripts/src/scripts/CreateUnitTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ target ('default': "Creates a new Grails unit test. A unit test requires that yo
grailsConsole.updateStatus "Creating test"
for (name in argsMap["params"]) {
name = purgeRedundantArtifactSuffix(name, 'Tests')
createUnitTest(name: name, suffix: "", testType:"Generic")
createUnitTest(name: name, suffix: "", testType:"UnitTest")
}
}

0 comments on commit fd9e0d9

Please sign in to comment.