On Mon, Mar 16, 2009 at 4:00 AM, Yun Huang Yong <y...@nomitor.com> wrote: > > Is there any way to test what the resultant log message is from evaluating > the block? > > i.e. something like: > log_mock.should_receive(:debug) { |log_block| > # execute log_block, and check its return value > }
Sorry - I don't quite understand. Do you want to test the logger debug method's behavior when you pass it a certain block, or do you want to test what the block itself does? If the former, it seems to me that you wouldn't want to mock the logger object. If the latter, you can just test the block directly. ///ark _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users