global
def around(*args, &block)
- execute test
- resume to call first part
def around(*args, &block) raise ArgumentError, "only :each or no argument is supported" if args != [] && args != [:each] fib = nil before do fib = Fiber.new do |context, resume| begin context.instance_exec(resume, &block) rescue Object fib = :failed raise end end fib.resume(self, lambda { Fiber.yield }) end after { fib.resume if fib && fib != :failed } end