From: Vincent Pit Date: Mon, 6 Oct 2008 16:34:00 +0000 (+0200) Subject: Test wrong action package X-Git-Tag: v0.03~2 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Frgit.git;a=commitdiff_plain;h=562b5b071d1f6c470aec102231476d952cc14cb5;hp=ab6f258a18f074ed6f18d29d98ea13b6d708e3a2 Test wrong action package --- diff --git a/t/15-failures.t b/t/15-failures.t index c39407c..296ffc8 100644 --- a/t/15-failures.t +++ b/t/15-failures.t @@ -6,7 +6,7 @@ use warnings; use Cwd qw/cwd/; use File::Spec::Functions qw/catdir/; -use Test::More tests => 44; +use Test::More tests => 45; use App::Rgit; @@ -89,6 +89,9 @@ $res = eval { App::Rgit::Command->action('beer') }; is($@, '', 'App::Rgit::Command->action("beer"): does not croak'); is($res, 'App::Rgit::Test::Pub', 'App::Rgit::Command->action("beer"): returns valid answer'); +$res = eval { App::Rgit::Command->new(cmd => 'beer') }; +like($@, qr!Couldn't\s+load\s+App::Rgit::Test::Pub\s*:!, 'App::Rgit::Command->new(cmd => "pub"): croaks'); + use App::Rgit::Config; my $arc = App::Rgit::Config->new(root => 't', git => 't/bin/git');