From 6e012ee749903e4b5b49004e12b30a69be5bf911 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 21 Jun 2013 10:04:21 -0400 Subject: make runtime warnings optional --- t/02-conflicts.t | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 't/02-conflicts.t') diff --git a/t/02-conflicts.t b/t/02-conflicts.t index 663b1e8..3d288a2 100644 --- a/t/02-conflicts.t +++ b/t/02-conflicts.t @@ -5,21 +5,6 @@ use Test::More; use Test::Fatal; use lib 't/lib/02'; -sub use_ok_warnings { - my ($class, @conflicts) = @_; - local $Test::Builder::Level = $Test::Builder::Level + 1; - @conflicts = sort map { "Conflict detected for $_->[0]:\n $_->[1] is version $_->[2], but must be greater than version $_->[3]\n" } @conflicts; - - my @warnings; - { - local $SIG{__WARN__} = sub { push @warnings, $_[0] }; - use_ok($class); - } - @warnings = sort @warnings; - - is_deeply(\@warnings, \@conflicts, "correct runtime warnings for $class"); -} - { use_ok('Foo::Conflicts::Good'); is_deeply( @@ -35,11 +20,7 @@ sub use_ok_warnings { } { - use_ok_warnings( - 'Foo::Conflicts::Bad', - ['Foo::Conflicts::Bad', 'Foo::Two', '0.02', '0.02'], - ['Foo::Conflicts::Bad', 'Foo', '0.02', '0.03'], - ); + use_ok('Foo::Conflicts::Bad'); is_deeply( [ Foo::Conflicts::Bad->calculate_conflicts ], @@ -71,12 +52,7 @@ sub use_ok_warnings { } { - use_ok_warnings( - 'Bar::Conflicts::Bad', - ['Bar::Conflicts::Bad2', 'Bar::Two', '0.02', '0.02'], - ['Bar::Conflicts::Bad', 'Bar::Two', '0.02', '0.02'], - ['Bar::Conflicts::Bad', 'Bar', '0.02', '0.03'], - ); + use_ok('Bar::Conflicts::Bad'); is_deeply( [ Bar::Conflicts::Bad->calculate_conflicts ], -- cgit v1.2.3-54-g00ecf