Does speck do something something special with static declartions?

4 views
Skip to first unread message

Barry Kaplan

unread,
Dec 16, 2009, 6:44:53 PM12/16/09
to Spock Framework
I have

class DroolsGroovyTestFixture extends Specification { ... }

class DeviceOperatingRulesTest extends DroolsGroovyTestFixture {
static def None = scala.None.MODULE$
// None is resolved and can be used
}

In this case None is resolved correctly.

But if I move the declaration to DroolsGroovyTestFixture

class DroolsGroovyTestFixture extends Specification {
static def None = scala.None.MODULE$
}

class DeviceOperatingRulesTest extends DroolsGroovyTestFixture {
// None is NOT resolved,
// get the error "groovy.lang.MissingPropertyException: No such
property: MODULE$ for class: scala.None"
}

Does this have something to do with Spocks transformations maybe?

Barry Kaplan

unread,
Dec 16, 2009, 6:45:50 PM12/16/09
to Spock Framework
Oh, I also tried:

- using @Shared
- initializing in DroolsGroovyTestFixture.setup()
- initializing in DroolsGroovyTestFixture.setupSpec()

Barry Kaplan

unread,
Dec 16, 2009, 6:48:32 PM12/16/09
to Spock Framework
Ah never mind. My propertyMissing is doing some of the heavy lifting,
which isn't initialized when the superclass is executed.
Reply all
Reply to author
Forward
0 new messages