in reply to Overriding a module that is used by a program I'm testing
This will replace Proc::Background::new with your own version, which can do whatever works best for your tests. Note, though, that this doesn't allow for using SUPER to access the original version of the replaced sub(s) because it's redefining the existing sub, not overriding them in proper OO fashion.use Proc::Background; # Make sure it's loaded at compile-time package Proc::Background; no warnings 'redefine'; sub new { do_stubby_stuff(@_) } package main; # Go about your testing business
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Overriding a module that is used by a program I'm testing
by Narveson (Chaplain) on Dec 08, 2010 at 15:17 UTC | |
by 7stud (Deacon) on Dec 10, 2010 at 00:50 UTC | |
|
Re^2: Overriding a module that is used by a program I'm testing
by anonymized user 468275 (Curate) on Dec 08, 2010 at 22:38 UTC | |
by dsheroh (Monsignor) on Dec 09, 2010 at 09:06 UTC |