From: Michael Neumann Date: 2004-06-05T03:41:37+09:00 Subject: Re: Check assertion in Ruby On Sat, Jun 05, 2004 at 03:34:47AM +0900, Edgardo Hames wrote: > Hi, everybody. I would like to use an assert like function to test the > number of rows returned by a query. Something like Eiffel's > > check result.num_rows = 1 > > What's the best way to do that in Ruby? def check raise "check failed" unless yield end check { result.num_rows == 1 } Regards, Michael