[rspec-users] Testing return value of a block argument
Peter Jaros
peter.a.jaros at gmail.com
Sun Mar 22 11:33:00 EDT 2009
Going forward, what do people think about being able to say
mock.should_receive(:debug).with_block { |log_block|
# execute log_block, and check its return value
}
Thoughts?
Peter
On Sat, Mar 21, 2009 at 8:25 PM, Mark Wilden <mark at mwilden.com> wrote:
> On Mon, Mar 16, 2009 at 4:00 AM, Yun Huang Yong <yun at nomitor.com> wrote:
>>
>> i.e. something like:
>> log_mock.should_receive(:debug) { |log_block|
>> # execute log_block, and check its return value
>> }
>
> I suppose you could always look at the source code for the debug
> method, find out what it does with the result of the block and set an
> expectation on that behavior.
>
> ///ark
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
More information about the rspec-users
mailing list