summaryrefslogtreecommitdiffstats
path: root/t/runtime.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-04-03 10:27:04 -0400
committerJesse Luehrs <doy@tozt.net>2014-04-03 10:28:58 -0400
commita8b31060a0fe668b36d0dceb83c2b1a7621ab988 (patch)
tree84e8ba6da7b2f57b5d2ec9f41e5c8af61a8db3f8 /t/runtime.t
parent5e66ba386054290656265f85898d87f2c4572fc9 (diff)
downloaddist-checkconflicts-a8b31060a0fe668b36d0dceb83c2b1a7621ab988.tar.gz
dist-checkconflicts-a8b31060a0fe668b36d0dceb83c2b1a7621ab988.zip
stop using use_ok
Diffstat (limited to 't/runtime.t')
-rw-r--r--t/runtime.t10
1 files changed, 6 insertions, 4 deletions
diff --git a/t/runtime.t b/t/runtime.t
index c1caae2..5125e91 100644
--- a/t/runtime.t
+++ b/t/runtime.t
@@ -4,7 +4,9 @@ use warnings;
use Test::More;
use lib 't/lib/runtime';
-sub use_ok_warnings {
+use Module::Runtime 'require_module';
+
+sub warnings_ok {
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;
@@ -12,19 +14,19 @@ sub use_ok_warnings {
my @warnings;
{
local $SIG{__WARN__} = sub { push @warnings, $_[0] };
- use_ok($class);
+ require_module($class);
}
@warnings = sort @warnings;
is_deeply(\@warnings, \@conflicts, "correct runtime warnings for $class");
}
-use_ok_warnings(
+warnings_ok(
'Foo',
['Foo::Conflicts', 'Foo::Foo', '0.01', '0.01'],
['Foo::Conflicts', 'Foo::Bar', '0.01', '0.01'],
);
-use_ok_warnings(
+warnings_ok(
'Bar',
['Bar::Conflicts', 'Bar::Baz::Bad', '0.01', '0.01'],
['Bar::Conflicts', 'Bar::Foo::Bad', '0.01', '0.01'],