How to catch an Exception with Spock

Groovy and Grails Technologies

How to use Spock library First of all, Spock is a unit-testing library which is usually used with Grails and Groovy. So you have to import the spock dependency in the Build.groovy or Pom.xml: ‘org.spockframework:spock-core:1.0-groovy-2.4’ group: ‘cglib’, name: ‘cglib-nodep’, version: ‘2.2.2’ (* Cglib library, it is necessary for mocking objects) … Continue reading