import spock.lang.Specification
interface M { int sum( int a, int b ) }
class SampleSpec extends Specification
{
def "mock-sample"( x, y, z )
{
given: M m = Mock()
when : int result = m.sum( x, y )
then : 1 * m.sum( x, y ) >> ( x + y )
result == z
where:
x | y | z
1 | 2 | 3
0 | 5 | 5
}
}