override.t: Suppress deprecation warning
authorFather Chrysostomos <sprout@cpan.org>
Tue, 4 Dec 2012 22:40:26 +0000 (14:40 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 4 Dec 2012 22:40:26 +0000 (14:40 -0800)
If we have overridden CORE::GLOBAL::require for the sake of testing it,
we can’t do ‘no warnings’ obviously.

t/op/override.t

index e62f785..9202957 100644 (file)
@@ -63,7 +63,11 @@ is( $r, join($dirsep, "Foo", "Bar.pm") );
 }
 
 {
-    no warnings 'deprecated';
+    BEGIN {
+        # Can’t do ‘no warnings’ with CORE::GLOBAL::require overridden. :-)
+        CORE::require warnings;
+        unimport warnings 'deprecated';
+    }
     my $_ = 'bar.pm';
     require;
     is( $r, 'bar.pm' );