Skip to content

Instantly share code, notes, and snippets.

@aeg
Created February 17, 2013 13:17
Show Gist options
  • Save aeg/4971454 to your computer and use it in GitHub Desktop.
Save aeg/4971454 to your computer and use it in GitHub Desktop.
SpockとJUnitが混在したテストクラス。
import org.junit.Test
import org.junit.experimental.runners.Enclosed
import org.junit.runner.RunWith;
import spock.lang.Specification
@RunWith(Enclosed.class)
class SpockJUnitMixTest {
static class Spockテストグループ1 extends Specification{
def "Spockテスト1-1"() {
when:
println "Spock test1:"
then:
true
}
}
static class Spockテストグループ2 extends Specification {
def "Spockテスト2-1"() {
when:
println "Spock test2:"
then:
true
}
}
static class JUnitテストグループ {
@Test
public void junitのテスト() {
System.out.println("JUnit test:");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment