I'm new to spock and noticed the setup: step in a specification is scoped local to that specific test. How might I share setup across these fixtures similar to the traditional junit approach?
thank you!
def "setup with spock"() {
setup:
def message = new FooMessage()
def sut = new FooProcessor()
def builder = Mock(FooBuilder)
sut.setBuilder(builder)
when:
builder.buildFooUsing(_) >> {"bar"}
def result = sut.process(message)
then:
assert result == "bar"
}