Skip to content

Fix type inferencing for Spock test method with data table #812

@eric-milles

Description

@eric-milles

Consider the following:

import spock.lang.*
final class SpockTests extends Specification {
  @Unroll
  void 'test #a equals #b'() {
   expect:
    a == b
   where:
    a | b
    1 | 1
    2 | a
  }
}

The spock transform adds parameters "a" and "b" to the test method. This is throwing off the type inference engine and so occurrences of "a" and "b" are showing as unknown (underlined).

See also: https://stackoverflow.com/questions/54597908/spock-test-eclipse-doesnt-seem-to-recoganize-the-data-variables-in-where-claus

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions