X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F39load_namespaces_rt41083.t;h=05378c80a0ad64dbf2ee2c9959e2f7b90aeb9294;hb=d5dedbd62928f65a9071b4d9b6d56c6b663a073b;hp=fbd723bbeef873e2a3c8aaac0fd2ea1d067b989c;hpb=624e2bc24f18d1bab9efc2c7ea2934a325439ee2;p=dbsrgits%2FDBIx-Class.git diff --git a/t/39load_namespaces_rt41083.t b/t/39load_namespaces_rt41083.t index fbd723b..05378c8 100644 --- a/t/39load_namespaces_rt41083.t +++ b/t/39load_namespaces_rt41083.t @@ -1,12 +1,9 @@ -#!/usr/bin/perl - use strict; use warnings; -use Test::More; use lib 't/lib'; - -plan tests => 8; +use DBICTest; # do not remove even though it is not used +use Test::More tests => 8; sub _chk_warning { defined $_[0]? @@ -19,6 +16,15 @@ sub _chk_extra_sources_warning { defined $_[0]? $_[0] !~ /$p/ : 1; } +sub _verify_sources { + my @monikers = @_; + is_deeply ( + [ sort DBICNSTest::RtBug41083->sources ], + \@monikers, + 'List of resultsource registrations', + ); +} + { my $warnings; eval { @@ -35,12 +41,9 @@ sub _chk_extra_sources_warning { ok(!$@) or diag $@; ok(_chk_warning($warnings), 'expected no resultset complaint'); ok(_chk_extra_sources_warning($warnings), 'expected no extra sources complaint') or diag($warnings); -} -is_deeply ( - [ DBICNSTest::RtBug41083->sources ], - [qw/ /], -); + _verify_sources (qw/A A::Sub/); +} { my $warnings; @@ -57,10 +60,6 @@ is_deeply ( ok(!$@) or diag $@; ok(_chk_warning($warnings), 'expected no resultset complaint') or diag $warnings; ok(_chk_extra_sources_warning($warnings), 'expected no extra sources complaint') or diag($warnings); -} - -is_deeply ( - [ DBICNSTest::RtBug41083->sources ], - [qw/ /], -); + _verify_sources (qw/A A::Sub Foo Foo::Sub/); +}