Created
October 14, 2014 12:11
-
-
Save Dierk/b5ddddc82dee456ccff6 to your computer and use it in GitHub Desktop.
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
//@Grab('org.spockframework:spock-core:0.7-groovy-2.0') | |
import spock.lang.* | |
import java.lang.reflect.Field | |
class FregeSpec extends Specification { | |
@Shared Class testClass = realworld.experiments.ExampleTests | |
@Shared List<Field> testFields = testClass.fields.findAll { Field it -> it.modifiers == 25 && it.name.startsWith("test") } | |
@Unroll | |
def "frege test #name"(name, value) { | |
expect: | |
value | |
where: | |
name << testFields.collect {Field it -> "$testClass.name $it.name"} | |
value << testFields.collect {Field it -> it.getBoolean(testClass)} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment