Issues with Groovy 5 and with
#2275
Unanswered
jochenberger
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
Oh, this is interesting: @Grab(group='org.spockframework', module='spock-core', version='2.4-M7-groovy-5.0')
import spock.lang.*
class TestSpec extends Specification {
static Locale DE = Locale.GERMAN
def "foo"(){
expect:
DE == Locale.GERMAN
with(''){
DE == Locale.GERMAN // works
}
with([DE:Locale.GERMAN]){
DE == Locale.GERMAN // works
}
with([:]){
DE == Locale.GERMAN // fails with Groovy 5 but works with 4.
}
}
}So, if the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I found some odd behavior when migrating one of my projects to Groovy 5. I'm not sure whether it's to be expected. It seems to have something to do with how properties are resolved inside closures.
The output is
With the Groovy 4 module, the test passes.
Can someone please help me understand what's going on here?
Beta Was this translation helpful? Give feedback.
All reactions