From: Christian Walde Date: Sat, 11 Feb 2012 18:29:42 +0000 (+0100) Subject: added a test for errors in load_module resulting in "unknown error" X-Git-Tag: v1.000000~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=49d332df39656855cadaa6d4775f6df1a238b7c9;p=gitmo%2FRole-Tiny.git added a test for errors in load_module resulting in "unknown error" --- diff --git a/t/lib/base_class.pm b/t/lib/base_class.pm new file mode 100644 index 0000000..c5dcaad --- /dev/null +++ b/t/lib/base_class.pm @@ -0,0 +1,7 @@ +use strictures; + +package base_class; +use Moo; +extends "marp"; + +1; diff --git a/t/lib/sub_class.pm b/t/lib/sub_class.pm new file mode 100644 index 0000000..3959550 --- /dev/null +++ b/t/lib/sub_class.pm @@ -0,0 +1,7 @@ +use strictures; + +package sub_class; + +use Moo; + +extends 'base_class'; diff --git a/t/load_module_error.t b/t/load_module_error.t new file mode 100644 index 0000000..464ef29 --- /dev/null +++ b/t/load_module_error.t @@ -0,0 +1,14 @@ +use strictures; + +package load_module_error; + +use Test::More; + +use lib 't/lib'; + +eval "use sub_class;"; + +ok $@, "got a crash"; +unlike $@, qr/Unknown error/, "it came with a useful error message"; + +done_testing;