Robert Feldt actually requested this back in ruby-talk:11158, but
nothing every come of it then (and I'm hurting for it now), so I thought
I'd bring it back up again. I'll add a RubyGarden RCR after there's a
bit of discussion.

Why do I need it? Well, currently you'll find the following at the top
of the at_exit block in test/unit.rb:

        set_trace_func DEBUGGER__.context.method(:trace_func).to_proc if
$DEBUG

I need this because the trace_func is no longer registered when at_exit
gets called, so if it's missing, I can't debug tests run with unit.rb.
OK, no problem, I can handle that UNTIL... somebody wants to profile
their tests. Uh oh. Now I have two ugly lines like that. And it only
works for those two... not Joe Schmoe's Nifty Debugger or some other
cool thing that gets done with a trace_func.

If I had Kernel.trace_func (which I think is an OK name... but the name
is not what's important to me at this point), I could just add a BEGIN
block to unit.rb:

        BEGIN { $saved_trace_func = trace_func }

and change the line in at_exit like so:

        set_trace_func $saved_trace_func

And it oughta work for any old trace_func that's thrown at it.

If there's a better way to handle this, by all means, point me at it.
But if not, what of the RCR?

Comments? Questions? Snide remarks?


Nathaniel

<:((><
+ - -
| RoleModel Software, Inc.
| EQUIP VI