Fix RT#59738, show_internal_actions produces warnings in debug mode
[catagits/Catalyst-Runtime.git] / t / live_show_internal_actions_warnings.t
diff --git a/t/live_show_internal_actions_warnings.t b/t/live_show_internal_actions_warnings.t
new file mode 100644 (file)
index 0000000..e68edca
--- /dev/null
@@ -0,0 +1,25 @@
+use strict;
+use warnings;
+use FindBin '$Bin';
+use lib "$Bin/lib";
+use Test::More;
+use File::Spec;
+BEGIN { # Shut up debug output, app needs debug on for the issue to
+        # appear, but we don't want the spraff to the screen
+
+    my $devnull = File::Spec->devnull;
+    open my $fh, '>', $devnull or die "Cannot write to $devnull: $!";
+
+    *STDERR = $fh;
+}
+
+use Catalyst::Test 'TestAppShowInternalActions';
+
+my $last_warning;
+{
+    local $SIG{__WARN__} = sub { $last_warning = shift };
+    get('/');
+}
+is( $last_warning, undef, 'there should be no warnings about uninitialized value' );
+
+done_testing;