by frederikb · 12y ago · 0 comments
It has a great syntax for data driven and interaction based syntax.
Data driven example:
class Math extends Specification {
def "maximum of two numbers"(int a, int b, int c) {
expect:
Math.max(a, b) == c
where:
a | b | c
1 | 3 | 3
7 | 4 | 4
0 | 0 | 0
}
}
[1] https://code.google.com/p/spock/With DSL's in groovy it always looks like the provided syntax is trying to code around Groovy's syntactic limitations, e.g. having to use the bar | in the example
a | b | c
1 | 3 | 3
7 | 4 | 4