Created
May 9, 2019 22:57
-
-
Save jaco0646/6347541de3591bf8845a4a837b5dcdae to your computer and use it in GitHub Desktop.
Spock Lifecycle
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
import spock.lang.Specification | |
class SpockLifecycleSpec extends Specification { | |
def setupSpec() { | |
println 'setupSpec' | |
} | |
def setup() { | |
println 'setup' | |
} | |
def cleanup() { | |
println 'cleanup' | |
} | |
def cleanupSpec() { | |
println 'cleanupSpec' | |
} | |
def test() { | |
given: | |
println 'given' | |
when: | |
println 'when' | |
then: | |
println 'then' | |
interaction { | |
println 'interaction' | |
} | |
where: | |
where << [where(1), where(2)] | |
} | |
static where(int count) { | |
println "where$count" | |
} | |
} | |
//setupSpec | |
//where1 | |
//where2 | |
//setup | |
//given | |
//interaction | |
//when | |
//then | |
//cleanup | |
//setup | |
//given | |
//interaction | |
//when | |
//then | |
//cleanup | |
//cleanupSpec |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment