summaryrefslogtreecommitdiffstats
path: root/t/02-conflicts.t
diff options
context:
space:
mode:
Diffstat (limited to 't/02-conflicts.t')
-rw-r--r--t/02-conflicts.t26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/02-conflicts.t b/t/02-conflicts.t
index 3d288a2..f59777f 100644
--- a/t/02-conflicts.t
+++ b/t/02-conflicts.t
@@ -3,6 +3,7 @@ use strict;
use warnings;
use Test::More;
use Test::Fatal;
+use Test::Warn;
use lib 't/lib/02';
{
@@ -69,4 +70,29 @@ use lib 't/lib/02';
);
}
+{
+ # conflicting module is utterly broken
+
+ use_ok('Foo::Conflicts::Broken');
+
+ my @conflicts;
+ warning_like { @conflicts = Foo::Conflicts::Broken->calculate_conflicts }
+ qr/Warning: Broken did not compile/,
+ 'Warning is issued when Broken fails to compile';
+
+ is_deeply(
+ \@conflicts,
+ [
+ { package => 'Broken', installed => 'unknown', required => '0.03' },
+ ],
+ "correct versions for all conflicts",
+ );
+
+ is(
+ exception { Foo::Conflicts::Broken->check_conflicts },
+ "Conflicts detected for Foo::Conflicts::Broken:\n Broken is version unknown, but must be greater than version 0.03\n",
+ "correct conflict error"
+ );
+}
+
done_testing;