From: Robert Klemme Date: 2012-09-12T18:00:28+09:00 Subject: Re: Using binding + set_trace_func to capture execution state Thank you for the elaborate answer. I need to muse a bit about this. Just one quick thought: On Tue, Sep 11, 2012 at 10:22 PM, Jonathan Tran wrote: > Also, a test (unit, functional, etc.) will print out a bad value that is > asserted. However, I specifically avoid assertions on intermediate > values which are implementation-dependent, because they make tests > brittle. But these intermediate values are often very useful in fixing > the final result. So I'd like to be able to easily *see* the > intermediate values without having to manually add and remove inspects > or step through the debugger every time. At least that could be fixed with a customized version of assert methods which would also pp a specific instance (or self as default) when the assertion fails so you can see all the internal state. Second thought: you could use set_trace_func and custom assert methods in order to record method calls and state and only output it when the assert fails. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/