Skip Menu |

This queue is for tickets about the Test-MockObject CPAN distribution.

Report information
The Basics
Id: 70477
Status: new
Priority: 0/
Queue: Test-MockObject

People
Owner: Nobody in particular
Requestors: sbaynes [...] fastmail.co.uk
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.20110612
Fixed in: (no value)



Subject: fake_module with import
It would be useful if $mock->fake_module() could provide support for generating a standard exporter type import function. I am getting fed up with writing horrid code like: $mock->fake_module( 'XXX::Util::Shutdown', import => sub { package XXX::Util::Shutdown; our @ISA = qw(Exporter); our @EXPORT_OK = qw(reboot); __PACKAGE__->export_to_level(1, "XXX::Util::Shutdown", 'reboot'); package main; }, reboot => \&reboot, ); Test::MockModule is no help as it assumes the module being mocked is available to load and modify. I am trying to test against modules that export with Exporter and that are not available in the source/test environment and will only become available in the [embedded] production environment which does not include the tests.