The nginx bullshit can just die
[catagits/Catalyst-Runtime.git] / t / unit_utils_load_class.t
index d23ca1c..881b1ff 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 16;
+use Test::More tests => 18;
 use Class::MOP;
 
 use lib "t/lib";
@@ -16,7 +16,10 @@ BEGIN { use_ok("Catalyst::Utils") };
 }
 
 my $warnings = 0;
-$SIG{__WARN__} = sub { $warnings++ };
+$SIG{__WARN__} = sub {
+    return if $_[0] =~ /Subroutine (?:un|re|)initialize redefined at .*C3\.pm/;
+    $warnings++;
+};
 
 ok( !Class::MOP::is_class_loaded("TestApp::View::Dump"), "component not yet loaded" );
 
@@ -63,3 +66,9 @@ undef $@;
 eval { Catalyst::Utils::ensure_class_loaded('Silly::File::Name.pm') };
 like($@, qr/Malformed class Name/, 'errored sanely when given a classname ending in .pm');
 
+undef $@;
+$warnings = 0;
+Catalyst::Utils::ensure_class_loaded("NullPackage");
+is( $warnings, 1, 'Loading a package which defines no symbols warns');
+is( $@, undef, '$@ still undef' );
+