in reply to Simulating the absence of a module

I think Test::MockObject is what you're looking for.

Replies are listed 'Best First'.
Re^2: Simulating the absence of a module
by adrianh (Chancellor) on Jul 04, 2005 at 17:50 UTC
    I think Test::MockObject is what you're looking for.

    Nope. T::MO is about faking existing packages, not pretending a package doesn't exist.

      You can use it for that purpose though. See the tutorial on perl.com.
        You can use it for that purpose though. See the tutorial on perl.com.

        ++. You're right - my apologies. For those who've not come across this way of using T::MO before:

        my $mock = Test::MockObject->new(); $mock->fake_module('Foo::Bar' => ( 'import' => sub { die "Foo::Bar could not be loaded" } )); use_ok('Foo::Bar');