Groovy Spock: is it possible to make "shared" a group of variables? -
i have big group of variables in spock test. first half of them objects need serious effort created, , second 1 constants. want mark these objects @shared annotation. may there better , shorter way evaluate task?
placing 20 or 30 similair annotations 1 after 1 not groovy way, suppose..
you have single context, 1 @shared
class test extends specification { @shared context = [ one: new one(), two: new two() ] def "use of context"() { expect: context.one.// context.two.// } }
Comments
Post a Comment