in reply to Re: Test::Class & self-shunt pattern
in thread Documenting Methods/Subs
The problem with it, as I see it is that, with optimisitic typing (ie, just passing in $self), you get an immediate failure if the object under test calls an unexpected method simply because you haven't implemented it.
Fair point. Although in some circumstances that could be what you want :-)
Instead of replacing stuff I sometimes just add instrumentation with something like Hook::LexWrap - handy when retrofitting tests onto tightly coupled code.
This really comes down to how much value you see in the strict typing of variables.
Well, all the ways of doing it in perl suck in one way or another so I don't often use it, but it's nice if done right (Eiffel springs to mind).
Method selecters are cool, and interfaces would be yet another solution.
Maybe in perl6 :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Test::Class & self-shunt pattern
by pdcawley (Hermit) on Jan 13, 2003 at 11:52 UTC | |
by adrianh (Chancellor) on Jan 13, 2003 at 12:09 UTC | |
by pdcawley (Hermit) on Jan 13, 2003 at 12:15 UTC |