Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Why mock doesn't work in this case?

by tobyink (Canon)
on Jan 06, 2012 at 10:05 UTC ( [id://946571]=note: print w/replies, xml ) Need Help??


in reply to Why mock doesn't work in this case?

Son::new doesn't return the blessed object. Try:

sub new { *{'Father::alert'} = sub { print 'son' . $/; }; bless {}, Son; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://946571]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-16 03:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found