I\'m trying to run a scenario several (30) times in order to get a nice statistical sample. However the block is only executing once; each subsequent time results in the sce
One possibility might be to keep the passed-in block as it is, and call the ".call" method on a duplicate? Something like (untested):
Around do |scenario, block|
30.times do
duplicate = block.dup
before_hook(scenario)
duplicate.call
after_hook(scenario)
end
end
Just make sure not to use ".clone" on the block, since clone will create an object with the same Id, resulting in every change made to the duplicate also affecting the original.