You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found that inserting a single variable declaration immediately after the setup: or when: labels will get around this issue. In other words, the error seems to manifest when non-initialized multiple variable declarations immediately follow the setup: or when: blocks.
This works as expected:
def "foo"() {
when:
def aSingleVar // when this is present, the next line is allowed
def a, b
a = 0
b = 1
then:
a != b
}
Hi,
I can't seem to define, without initializing, multiple variables in one line inside a
when
or asetup
block.Example:
This fails when accessing b:
No such property: b for class: ....
Moving the declaration outside the block works.
I am using:
http://stackoverflow.com/questions/32763054/declare-multiple-variables-in-one-line-in-spock-when-block/32765082#32765082
The text was updated successfully, but these errors were encountered: