[mocha-developer] Trapping a block

Dustin Tinney tinney at gmail.com
Thu May 1 13:42:05 EDT 2008


We were trying to test this the other day and couldn't figure out if  
it was possible to trap the block that was being passed in:

def do_something(foo)
   Bar.transaction do
     foo.baz()
   end
end

We can do an expectation on foo and an expectation on Bar  but is it  
possible to test that foo.baz() happened inside of the Bar transaction  
block?

Thanks...


More information about the mocha-developer mailing list