Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: intercept nonexistent methods call

by Bor (Beadle)
on Aug 04, 2011 at 10:24 UTC ( #918486=note: print w/replies, xml ) Need Help??


in reply to Re: intercept nonexistent methods call
in thread intercept nonexistent methods call

Thank you for reply.

Forgot to say: subclass - is a test mock module, so I have Module & Module::Mock.
In tests I redefine like this
local *Module::new = sub { Module::Mock->new(); };
I want to see what methods called from this test module.
And yes, you are right - maybe I not need inheritance from "real" class. Then I can control all methods calls.

Replies are listed 'Best First'.
Re^3: intercept nonexistent methods call
by Bor (Beadle) on Aug 04, 2011 at 11:24 UTC
    This is not working as I want :(
    If I comment "parent Module;" in Module::Mock.
    Then code
    local *Module::new = sub { Module::Mock->new(); };
    do not gives any effect and in other modules Module->new() calls.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://918486]
help
Chatterbox?
[Corion]: dazz: BTW, the following should work (no Image::Magick installed, so untested): open(my $fh, '<', \$jpegbuffer); $image->Read(file= > $fh);
[choroba]: Hm, it seems my humble contributions to CPAN pass their test suites with the PERL5OPT set

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2017-03-27 08:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (317 votes). Check out past polls.