GNU Emacs 24.3.1
Gradle 1.12
spock-core.0.7
Hello,
I am doing unit testing with spock framework
using the gradle build
system.
When I run my tests gradle test
I just see a message like this:
* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///home/projs/gradleTest/build/reports/tests/index.html
Then I have to go and check the xml file to see what exception has been thrown
Is there any option where I could see the exceptions in my console output? For example I have some print message I would like printed to the console output:
catch(FileNotFoundException ex) {
System.out.println("Exception " + ex.toString());
}
catch(IOException ex) {
System.out.println("Exception " + ex.toString());
}
catch(Exception ex) {
System.out.println("Exception " + ex.toString());
}
My Gradle build file:
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'groovy'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile "com.googlecode.json-simple:json-simple:1.1.1"
testCompile "org.codehaus.groovy:groovy:2.3.3"
testCompile "org.spockframework:spock-core:0.7-groovy-2.0"
}
My spock unit test:
import spock.lang.Specification;
class SnapClientTest extends Specification {
def "Request from web services"() {
given:
SnapClient snapclient = new SnapClient()
expect:
snapclient.makeRequest() == 0
}
}
Many thanks in advance,
Test#testLogging
in the Gradle Build Language Reference. – Lessielessing