Remove dependency on Test::Warn by catching the warning ourself in the one test file...
[gitmo/Mouse.git] / t / 002-warnings.t
index 4d57726..f5195aa 100644 (file)
@@ -1,11 +1,20 @@
 #!/usr/bin/env perl
 use Test::More tests => 1;
-use Test::Warn;
 
-warning_like {
+# we used to use Test::Warn here but there's no point in adding three deps total
+# for this one easy test
+
+my @warnings;
+local $SIG{__WARN__} = sub {
+    push @warnings, "@_";
+};
+
+do {
     package Class;
     use Mouse;
 
     my $one = 1 + undef;
-} qr/uninitialized value/, 'using Mouse turns on warnings';
+};
+
+like("@warnings", qr/^Use of uninitialized value/, 'using Mouse turns on warnings');