About me
DevOps Advocate at ZeroTurnaround
Apache Groovy Committer
Created MacroGroovy & groovy macro methods
Slide 3
Slide 3 text
About me
DevOps Advocate at ZeroTurnaround
Apache Groovy Committer
Created MacroGroovy & groovy macro methods
Got drunk and fell yesterday at speakers’ dinner, lol :D
def fact(num) {
return match(num) {
when String then fact(num.toInteger())
when 0 or 1 then 1
when 2 then 2
orElse it * fact(it - 1)
}
}
DSL-like Pattern Matching
Slide 31
Slide 31 text
doWithData {
assert a + b == c
where:
a | b || c
1 | 2 || 3
4 | 5 || 9
7 | 8 || 15
}
Spock-like data tables