From 0d4d7d0d13bb122af3744bc5a61775c1bc8a978b Mon Sep 17 00:00:00 2001 From: franck cuny Date: Wed, 11 Aug 2010 11:12:49 +0200 Subject: use Class::MOP::load_class instead of plain eval - if the module is not found, die with message (close RT#59776) --- t/06_die_with_inexistant_class.t | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 t/06_die_with_inexistant_class.t (limited to 't') diff --git a/t/06_die_with_inexistant_class.t b/t/06_die_with_inexistant_class.t new file mode 100644 index 0000000..fcf600b --- /dev/null +++ b/t/06_die_with_inexistant_class.t @@ -0,0 +1,18 @@ +use strict; +use warnings; +use Test::More tests => 2; +use Test::Exception; + +BEGIN { + package My::Factory; + use MooseX::AbstractFactory; + use Moose; +} + +dies_ok { + my $imp = My::Factory->create( + 'FooBar', {} + ); +} "Factory->new() die"; + +like $@, qr/Can't locate My\/Factory\/FooBar.pm/; -- cgit v1.2.3