On Mon, Mar 16, 2009 at 4:00 AM, Yun Huang Yong 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 qu
On Sun, Mar 22, 2009 at 10:33 AM, Peter Jaros wrote:
> 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?
I like the idea, but I don't know how well it will pla
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 wrote:
> On Mon, Mar 16, 2009 at 4:00 AM, Yun Huang Yong wrote:
On Mon, Mar 16, 2009 at 4:00 AM, Yun Huang Yong 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
I have this exact same problem. Anyone have a solution?
TIA,
--
Guilherme Machado Cirne
gci...@gmail.com
On Mon, Mar 16, 2009 at 8:00 AM, Yun Huang Yong wrote:
> Hi,
>
> I'm using Log4r and one of its neat features is its handling of blocks such
> that you can do:
> log.debug { "Something b
On 16 Mar 2009, at 11:00, Yun Huang Yong wrote:
I'm using Log4r
You might want to check out this library, which seems to be better
maintained these days:
http://github.com/TwP/logging/tree/master
Matt Wynne
http://blog.mattwynne.net
http://www.songkick.com
__
On Mon, Mar 16, 2009 at 8:33 AM, Nick Hoffman 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. H
On Mon, Mar 16, 2009 at 7:00 AM, Yun Huang Yong wrote:
> Hi,
>
> I'm using Log4r and one of its neat features is its handling of blocks such
> that you can do:
> log.debug { "Something bad happened" + some_expensive_method() }
> instead of:
> log.debug("Something bad happened" + some_expensive_m
Hi,
I'm using Log4r and one of its neat features is its handling of blocks
such that you can do:
log.debug { "Something bad happened" + some_expensive_method() }
instead of:
log.debug("Something bad happened" + some_expensive_method())
The benefit of the former is that some_expensive_metho