Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
eric-milles opened this issue Feb 15, 2019 · 0 comments
Closed

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

eric-milles opened this issue Feb 15, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@eric-milles
Copy link
Member

eric-milles commented Feb 15, 2019

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

@eric-milles eric-milles self-assigned this Feb 15, 2019
@eric-milles eric-milles added this to the v3.3.0 milestone Feb 15, 2019
eric-milles added a commit that referenced this issue Jul 1, 2019
Global xforms disabled for:
- index
- find JUnit tests
- open in editor (aka become working copy)
- select in explorer (aka test for extract class refactor)

Global xforms enabled for:
- compile
- reconcile
- resolve source reference
- code minings (aka search)

Note: #812 is disabled until Spock xform is run as part of reconcile

Note: Scripts with @grab will now open in editor immediately and the
grabs are processed asynchronously as part of reconcile operation

Note: Global xforms that run during Conversion compiler phase are applied even if disabled by CompilerConfiguration setting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant