Spock Test with @Unroll

Answered

I'm seeing an odd output from the JetBrains test runner when running a Spock test with the @Unroll annotation. Here's an example test:

import spock.lang.Specification
import spock.lang.Unroll

class NoNameSpec extends Specification {

@Unroll
void "test for noName"(String test, String transformed) {
expect:
transformed == test.toUpperCase()

where:
test || transformed
'a' || 'A'
'b' || 'B'
'c' || 'C'
}
}

Here's what the test runner shows:

It's that <no name> entry that's bugging me.  When I run the same test in the Spock Web Console (http://meetspock.appspot.com/), I don't get that so I'm pretty sure this is an IDEA issue.

I'm running on a MacBook Pro:

IntelliJ IDEA 2016.2.1
Build #IU-162.1447.26, built on August 2, 2016
JRE: 1.8.0_76-release-b216 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

Any ideas why that <no name> entry is showing up?

3 comments
Comment actions Permalink

agree <no name> is confusing...

 

Another improovments proposal... double click to unroll test result should jump to source. Typically, when any of your test fail, you want to go to such test to investigate and fix it... so the first what you need when any test (unrolled test case) fail is to go to source... 

Please add such feature. Thanks a lot.

W

0

Please sign in to leave a comment.