Re: Updates to modules-related pod

2004-08-20 Thread Randal L. Schwartz
Rafael == Rafael Garcia-Suarez [EMAIL PROTECTED] writes: Rafael BTW, isn't the habit to post to c.l.p.announce a bit deprecated now ? Not at all. More people should do it. Don't remove it. Either that, or entertain a proposal to cancel the group. -- Randal L. Schwartz - Stonehenge

Test::MockObject nits?

2004-08-20 Thread Geoffrey Young
hi chromatic :) given being pointed toward Test::MockObject::Extends last time I decided to rework my tests to use it instead of a dozen local overrides. I immediately ran into a little snag. I want to override IO::Socket::INET so that a class calling it's constructor will use my mocked

Re: Test::MockObject nits?

2004-08-20 Thread Geoffrey Young
my $mock = Test::MockObject-new('IO::Socket::INET'); $mock-fake_new('IO::Socket::INET') -set_false('connected') -mock('error', sub { 'localerror' }); the goal being that when my class calls IO::Socket::INET-new($args) that it fails, returning my error string. well,

Re: Test::MockObject nits?

2004-08-20 Thread Geoffrey Young
It's your understanding. You're not mocking the class as a whole. You're mocking an instance. If it helps, think of prototype-based programming, where you don't inherit from classes, you inherit from other objects and selectively override or add methods on the new objects. hmm, ok, I'll

Re: Test::MockObject nits?

2004-08-20 Thread chromatic
On Fri, 2004-08-20 at 11:24, Geoffrey Young wrote: Test::MockObject is clearly object/instance based. Test::MockObject::Extends is documented to mock either an object or the class as a whole. if that's not the case that is fine (I guess ;), but then I'm very confused what value passing a

Re: Test::MockObject nits?

2004-08-20 Thread Geoffrey Young
The docs may be misleading, especially as there's code in Test::MockObject that really should live in something like Test::MockModule or Test::MockPackage, neither of which exist yet. The important point is that you always have to work with the object returned from