diff options
author | franck cuny <franck@lumberjaph.net> | 2010-08-11 11:12:49 +0200 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2010-08-11 11:12:49 +0200 |
commit | 0d4d7d0d13bb122af3744bc5a61775c1bc8a978b (patch) | |
tree | f451db1848c10c456c78e080c187343aa12e89b0 /t | |
parent | initial commit (diff) | |
download | moosex-abstractfactory-0d4d7d0d13bb122af3744bc5a61775c1bc8a978b.tar.gz |
use Class::MOP::load_class instead of plain eval - if the module is not found, die with message (close RT#59776) master
Diffstat (limited to 't')
-rw-r--r-- | t/06_die_with_inexistant_class.t | 18 |
1 files changed, 18 insertions, 0 deletions
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/; |