title: Output unit testing results on console using spock junit testing and gradle build system
body: <pre><code>GNU Emacs 24.3.1
  Gradle 1.12
  spock-core.0.7
  </code></pre>
  
  <p>Hello,</p>
  
  <p>I am doing unit testing with <code>spock framework</code> using the <code>gradle build</code> system.</p>
  
  <p>When I run my tests <code>gradle test</code> I just see a message like this:</p>
  
  <pre><code>* What went wrong:
  Execution failed for task ':test'.
  &gt; There were failing tests. See the report at: file:///home/projs/gradleTest/build/reports/tests/index.html
  </code></pre>
  
  <p>Then I have to go and check the xml file to see what exception has been thrown</p>
  
  <p>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:</p>
  
  <pre><code>    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());
      }
  </code></pre>
  
  <p>My Gradle build file:</p>
  
  <pre><code>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"
  }
  </code></pre>
  
  <p>My spock unit test:</p>
  
  <pre><code>import spock.lang.Specification;
  class SnapClientTest extends Specification {
      def "Request from web services"() {
          given:
          SnapClient snapclient = new SnapClient()
  
          expect:
          snapclient.makeRequest() == 0
      }
  }
  </code></pre>
  
  <p>Many thanks in advance,</p>