diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-01-13 01:17:24 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-01-13 01:17:24 -0600 |
commit | c1d96ea5ce0260890f0e496438ab762728877154 (patch) | |
tree | f4058671c96c810c9aa86b801ee58d72cafc9642 /t/02-conflicts.t | |
parent | 288de96a697f56d6a1e4166004e1462837c5aacb (diff) | |
download | dist-checkconflicts-c1d96ea5ce0260890f0e496438ab762728877154.tar.gz dist-checkconflicts-c1d96ea5ce0260890f0e496438ab762728877154.zip |
update tests to check for runtime warnings
Diffstat (limited to 't/02-conflicts.t')
-rw-r--r-- | t/02-conflicts.t | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/t/02-conflicts.t b/t/02-conflicts.t index 7303be2..e788815 100644 --- a/t/02-conflicts.t +++ b/t/02-conflicts.t @@ -20,7 +20,18 @@ use lib 't/lib/02'; } { - use_ok('Foo::Conflicts::Bad'); + { + my $warnings; + local $SIG{__WARN__} = sub { $warnings .= $_[0] }; + use_ok('Foo::Conflicts::Bad'); + is($warnings, <<'EOF', "got correct runtime warnings"); +Conflict detected for Foo::Conflicts::Bad: + Foo::Two is version 0.02, but must be greater than version 0.02 +Conflict detected for Foo::Conflicts::Bad: + Foo is version 0.02, but must be greater than version 0.03 +EOF + } + is_deeply( [ Foo::Conflicts::Bad->calculate_conflicts ], [ @@ -51,7 +62,20 @@ use lib 't/lib/02'; } { - use_ok('Bar::Conflicts::Bad'); + { + my $warnings; + local $SIG{__WARN__} = sub { $warnings .= $_[0] }; + use_ok('Bar::Conflicts::Bad'); + is($warnings, <<'EOF', "got correct runtime warnings"); +Conflict detected for Bar::Conflicts::Bad2: + Bar::Two is version 0.02, but must be greater than version 0.02 +Conflict detected for Bar::Conflicts::Bad: + Bar::Two is version 0.02, but must be greater than version 0.02 +Conflict detected for Bar::Conflicts::Bad: + Bar is version 0.02, but must be greater than version 0.03 +EOF + } + is_deeply( [ Bar::Conflicts::Bad->calculate_conflicts ], [ |