Hi Barry,
yes it's possible. The result generator is passed the list of
arguments for the invocation. Hence you can do: builder.transitionTo
(_) >> { it[0] }
Your way of capturing 'state' should also work. You just have to defer
evaluation of the result:
def state
builder.transitionTo({state = it; true}) >> { state }
Inserting 'true' makes sure that the interaction always matches.
Otherwise it would only match if 'state' evaluated to
'true' (according to Groovy truth).
Hope this helps.
Cheers,
Peter