If a derived parameter uses another parameter in a closure (for example in
collection methods), groovy.lang.MissingPropertyException is thrown. The same
construct works fine with regular variables.
Example:
class Example extends Specification {
def "success"(){
def x = [2, 4, 6]
def y = [1, 2, 3, 4].findAll {it in x}
expect:
y == [2, 4]
}
def "fail"(){
expect:
y == [2, 4]
where:
x = [2, 4, 6]
y = [1, 2, 3, 4].findAll {it in x}
}
}
Is it related to http://code.google.com/p/spock/issues/detail?id=274 ? Or is
this syntax not supposed to be supported in where-blocks?
Spock 0.7
Groovy 1.8.6
Original issue reported on code.google.com by nebehr.g...@gmail.com on 22 Nov 2012 at 12:36
Original issue reported on code.google.com by
nebehr.g...@gmail.com
on 22 Nov 2012 at 12:36