Grails/gradle - Running spock unit tests

I am using Intellij 14.0.2. I am trying to run grails controller test cases, which uses the spock framework. My grails projects uses gradle for build and use the grails-gradle plugin. There are a few issues.

1. When I right click on the test file and "Run", it runs the gradle "test" target. However, it runs all the test cases in the project. I just wanted to run a particular test. The run configuration created by intellij passes "--tests <test class"" but still runs all the test cases. How do I make it run a single test?

2. The test results are not reported in the "Run" tool window. The console says all the tests are run, but also says "Test events were not received" in the left side.

3. If any of the test fails, I see the test failure in the console, but I also see a build error.

    FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':<project name>:test'.
> No signature of method: org.gradle.util.LinePerThreadBufferingOutputStream.writeTo() is applicable for argument types: (org.gradle.util.LinePerThreadBufferingOutputStream) values: [org.gradle.util.LinePerThreadBufferingOutputStream@dba057e]
  Possible solutions: write([B), write(int), write([B), write(int), write(int), write([B)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Please sign in to leave a comment.