6 ms·
I second this. Spock is the best testing framework I've ever used. Same results on my team: much better test coverage just because writing tests is so much easi
by brabel 9y ago
I second this. Spock is the best testing framework I've ever used. Same results on my team: much better test coverage just because writing tests is so much easier and fun.
- vorg 9y agoYou are two users each talking about your team to promote a framework. I'll take some actual time to look at some code from the sole link here, which is the website: class DataDriven extends Specification { def "maximum of two numbers"() { expect: Math.max(a, b) == c where: a | b || c 3 | 5 || 5 7 | 0 || 7 0 | 0 || 0 } } I see here a DSL that * defines blocks without curlies by overloading the C-style label syntax normally used for break targets * overloads the | and || operators to build tables of data without quotes around it * uses strings as function names instead of camelCase The Apache Groovy DSL enables that by having a complex grammar and intercepting the AST during the compile. Clojure, also for the JVM, has a simple grammar and provides macros, which are convenient for eliminating syntax in repetitive tests. I switched from Groovy 1.x to Clojure years ago for testing on the JVM.