]> git.vpit.fr Git - perl/modules/rgit.git/blobdiff - t/15-failures.t
Test loading all modules
[perl/modules/rgit.git] / t / 15-failures.t
index c39407cdab01eae4fbba6f4cb0815578bbcfb86d..3217e23d990080058329012c1fd08fb4932e7754 100644 (file)
@@ -6,15 +6,12 @@ use warnings;
 use Cwd qw/cwd/;
 use File::Spec::Functions qw/catdir/;
 
-use Test::More tests => 44;
+use Test::More tests => 42;
 
 use App::Rgit;
 
 local $SIG{__WARN__} = sub { die @_ };
 
-eval { App::Rgit->new(qw/foo bar baz/) };
-like($@, qr!Optional\s+arguments\s+must\s+be\s+passed\s+as\s+keys?\s*/\s*values?\s+pairs?!, 'App::Rgit->new(even): croaks');
-
 my $res = eval { App::Rgit->new() };
 is($@,   '',    'App::Rgit->new(): no root: does not croak');
 is($res, undef, 'App::Rgit->new(): no root: returns undef');
@@ -43,10 +40,6 @@ $res = eval { $res->new(root => 't', git => 't/bin/git', cmd => 'version'); };
 is($@,       '',          '$ar->new(): no args: does not croak');
 isa_ok($res, 'App::Rgit', '$ar->new(): no args: returns an object');
 
-$res = eval { App::Rgit::new(undef, root => 't', git => 't/bin/git', cmd => 'version'); };
-is($@,       '',         'undef->App::Rgit::new(): no args: does not croak');
-isa_ok($res, 'App::Rgit','undef->App::Rgit::new(): no args: returns an object');
-
 use App::Rgit::Command;
 
 eval { App::Rgit::Command::Once->App::Rgit::Command::new(cmd => 'dongs') };
@@ -89,6 +82,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');