
JUnit vs. Spock – What's Wrong with JUnit - jakubdziworski
http://jakubdziworski.github.io/java/groovy/spock/2016/05/14/spock-cheatsheet.html
======
vorg
> Spock is that it’s basically a DSL (domain specifing language) for writing
> tests. It’s based on Groovy

I don't like the way Spock hacks Groovy's syntax for its DSL. The "expect" and
"where" are actually labels that can be jumped to, repurposed as some sort of
macro word. The | and || are operators for something else. Other languages
don't even allow boolean op || to be overloadable.

It's like Spock has gone to a lot of trouble to work around the restrictions
in Groovy's antiquated Antlr 2.7 based grammar.

    
    
      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
              3 | 5 || 5
              7 | 0 || 7
              0 | 0 || 0
          }
      }

~~~
dragonwriter
> Other languages don't even allow boolean op || to be overloadable.

Some languages don't allow overloading any operator, but of the ones that do,
several allow || to be overloaded. Ruby doesn't, but C++ does for example.

------
Nosdufad
I wonder if you can combine spock with cucumber

