Skip to content

Instantly share code, notes, and snippets.

@Dierk
Created October 14, 2014 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dierk/b5ddddc82dee456ccff6 to your computer and use it in GitHub Desktop.
Save Dierk/b5ddddc82dee456ccff6 to your computer and use it in GitHub Desktop.
//@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