X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Frun_if_script.t;fp=t%2Frun_if_script.t;h=dc66514d12843e6029945a186a35573ab7fba88f;hb=7346dbd367858f693d12a0180ee391b12cc8347a;hp=ede9d89b9fa514a344e8cf4b26c36b59bf46506f;hpb=fd8747e504c32074e49b1514b39418c32bd22a32;p=catagits%2FWeb-Simple.git diff --git a/t/run_if_script.t b/t/run_if_script.t index ede9d89..dc66514 100644 --- a/t/run_if_script.t +++ b/t/run_if_script.t @@ -1,6 +1,7 @@ use strictures; use Test::More; +use Test::Fatal 'exception'; { use Web::Simple 'RunTest'; @@ -12,6 +13,14 @@ use Test::More; sub run { @_, "run" } } +{ + use Web::Simple 'DieTest'; + + package DieTest; + use Moo; + has die => is => ro => required => 1; +} + is( sub { RunTest->run_if_script } ->(), @@ -39,4 +48,10 @@ is_deeply( "passing arguments to run_if_script has them passed on to the run method" ); +like( + exception { DieTest->_build_for_run_if_script }, # + qr/^Failed to create new 'DieTest' object during/, + "object creation in run_if_script decorates failure with useful information" +); + done_testing;