Does speck do something something special with static declartions?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Does speck do something something special with static declartions?

Barry Kaplan (2)
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?

--

You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does speck do something something special with static declartions?

Barry Kaplan (2)
Oh, I also tried:

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

--

You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Does speck do something something special with static declartions?

Barry Kaplan (2)
Ah never mind. My propertyMissing is doing some of the heavy lifting,
which isn't initialized when the superclass is executed.

--

You received this message because you are subscribed to the Google Groups "Spock Framework" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.


Loading...