Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Spock Framework the default test framework for Grails 2.3
- Loading branch information
1 parent
47d50d5
commit b079427
Showing
14 changed files
with
95 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 11 additions & 8 deletions
19
grails-resources/src/grails/templates/testing/Controller.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,15 +1,18 @@ | |||
@artifact.package@ | @artifact.package@import grails.test.mixin.TestFor | ||
|
import spock.lang.Specification | ||
import grails.test.mixin.* | |||
import org.junit.* | |||
|
|
||
/** | /** | ||
* See the API for {@link grails.test.mixin.web.ControllerUnitTestMixin} for usage instructions | * See the API for {@link grails.test.mixin.web.ControllerUnitTestMixin} for usage instructions | ||
*/ | */ | ||
@TestFor(@artifact.testclass@) | @TestFor(@artifact.testclass@) | ||
class @artifact.name@ { | class @artifact.name@ extends Specification { | ||
|
|||
def setup() { | |||
} | |||
|
|||
def cleanup() { | |||
} | |||
|
|
||
void testSomething() { | void "test something"() { | ||
fail "Implement me" | |||
} | } | ||
} | } |
19 changes: 11 additions & 8 deletions
19
grails-resources/src/grails/templates/testing/DomainClass.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,15 +1,18 @@ | |||
@artifact.package@ | @artifact.package@import grails.test.mixin.TestFor | ||
|
import spock.lang.Specification | ||
import grails.test.mixin.* | |||
import org.junit.* | |||
|
|
||
/** | /** | ||
* See the API for {@link grails.test.mixin.domain.DomainClassUnitTestMixin} for usage instructions | * See the API for {@link grails.test.mixin.domain.DomainClassUnitTestMixin} for usage instructions | ||
*/ | */ | ||
@TestFor(@artifact.testclass@) | @TestFor(@artifact.testclass@) | ||
class @artifact.name@ { | class @artifact.name@ extends Specification { | ||
|
|||
def setup() { | |||
} | |||
|
|||
def cleanup() { | |||
} | |||
|
|
||
void testSomething() { | void "test something"() { | ||
fail "Implement me" | |||
} | } | ||
} | } |
18 changes: 11 additions & 7 deletions
18
grails-resources/src/grails/templates/testing/Filters.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,11 +1,15 @@ | |||
@artifact.package@ | @artifact.package@import grails.test.mixin.Mock | ||
|
import spock.lang.Specification | ||
import grails.test.mixin.* | |||
|
|
||
@Mock(@artifact.testclass@) | @Mock(@artifact.testclass@) | ||
class @artifact.name@ { | class @artifact.name@ extends Specification { | ||
|
|||
def setup() { | |||
} | |||
|
|||
def cleanup() { | |||
} | |||
|
|
||
void testSomething() { | void "test something"() { | ||
fail "Implement me" | |||
} | } | ||
} | } |
26 changes: 13 additions & 13 deletions
26
grails-resources/src/grails/templates/testing/Generic.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,20 +1,20 @@ | |||
@artifact.package@import static org.junit.Assert.* | @artifact.package@ | ||
import org.junit.* | import grails.test.mixin.TestMixin | ||
import grails.test.mixin.support.GrailsUnitTestMixin | |||
import spock.lang.* | |||
|
|
||
class @artifact.name@ { | /** | ||
* See the API for {@link grails.test.mixin.support.GrailsUnitTestMixin} for usage instructions | |||
*/ | |||
@TestMixin(GrailsUnitTestMixin) | |||
class @artifact.name@ extends Specification { | |||
|
|
||
@Before | def setup() { | ||
void setUp() { | |||
// Setup logic here | |||
} | } | ||
|
|
||
@After | def cleanup() { | ||
void tearDown() { | |||
// Tear down logic here | |||
} | } | ||
|
|
||
@Test | void "test something"() { | ||
void testSomething() { | |||
fail "Implement me" | |||
} | } | ||
} | } |
19 changes: 11 additions & 8 deletions
19
grails-resources/src/grails/templates/testing/Service.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,15 +1,18 @@ | |||
@artifact.package@ | @artifact.package@import grails.test.mixin.TestFor | ||
|
import spock.lang.Specification | ||
import grails.test.mixin.* | |||
import org.junit.* | |||
|
|
||
/** | /** | ||
* See the API for {@link grails.test.mixin.services.ServiceUnitTestMixin} for usage instructions | * See the API for {@link grails.test.mixin.services.ServiceUnitTestMixin} for usage instructions | ||
*/ | */ | ||
@TestFor(@artifact.testclass@) | @TestFor(@artifact.testclass@) | ||
class @artifact.name@ { | class @artifact.name@ extends Specification { | ||
|
|||
def setup() { | |||
} | |||
|
|||
def cleanup() { | |||
} | |||
|
|
||
void testSomething() { | void "test something"() { | ||
fail "Implement me" | |||
} | } | ||
} | } |
19 changes: 11 additions & 8 deletions
19
grails-resources/src/grails/templates/testing/TagLib.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,15 +1,18 @@ | |||
@artifact.package@ | @artifact.package@import grails.test.mixin.TestFor | ||
|
import spock.lang.Specification | ||
import grails.test.mixin.* | |||
import org.junit.* | |||
|
|
||
/** | /** | ||
* See the API for {@link grails.test.mixin.web.GroovyPageUnitTestMixin} for usage instructions | * See the API for {@link grails.test.mixin.web.GroovyPageUnitTestMixin} for usage instructions | ||
*/ | */ | ||
@TestFor(@artifact.testclass@) | @TestFor(@artifact.testclass@) | ||
class @artifact.name@ { | class @artifact.name@ extends Specification { | ||
|
|||
def setup() { | |||
} | |||
|
|||
def cleanup() { | |||
} | |||
|
|
||
void testSomething() { | void "test something"() { | ||
fail "Implement me" | |||
} | } | ||
} | } |
21 changes: 8 additions & 13 deletions
21
grails-resources/src/grails/templates/testing/UnitTest.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,24 +1,19 @@ | |||
@artifact.package@import static org.junit.Assert.* | @artifact.package@import grails.test.mixin.TestMixin | ||
|
import grails.test.mixin.support.GrailsUnitTestMixin | ||
import grails.test.mixin.* | import spock.lang.Specification | ||
import grails.test.mixin.support.* | |||
import org.junit.* | |||
|
|
||
/** | /** | ||
* See the API for {@link grails.test.mixin.support.GrailsUnitTestMixin} for usage instructions | * See the API for {@link grails.test.mixin.support.GrailsUnitTestMixin} for usage instructions | ||
*/ | */ | ||
@TestMixin(GrailsUnitTestMixin) | @TestMixin(GrailsUnitTestMixin) | ||
class @artifact.name@ { | class @artifact.name@ extends Specification { | ||
|
|
||
void setUp() { | def setup() { | ||
// Setup logic here | |||
} | } | ||
|
|
||
void tearDown() { | def cleanup() { | ||
// Tear down logic here | |||
} | } | ||
|
|
||
void testSomething() { | void "test something"() { | ||
fail "Implement me" | |||
} | } | ||
} | } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters