On Mon, Mar 16, 2009 at 8:33 AM, Nick Hoffman <n...@deadorange.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
>>  }
>
> Hi Yun. Have a look at #and_yield , described at
> http://rspec.info/documentation/mocks/message_expectations.html .

That was my first thought, but and_yield stubs what the method will
yield, not what it should yield. It's like and_return.

///ark
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to