Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Blessing with unknown classnames

by perlfan (Vicar)
on Apr 02, 2021 at 05:27 UTC ( [id://11130700]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # bypass constructor, don't care about stuff done in Targeted::Module:
    +:new
    my $sneaky_instantiation = bless {}, q{Targeted::Module};
    ...
    # now call any method, e.g., for a unit test
    isa_ok q{Targeted::Module}, $sneaky_instantiation;
    ok q{expected value} eq $sneaky_instantiation->_internal_method(), q{u
    +nit test for _internal_method};
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-03-28 11:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found