Tests for double dot bug
[catagits/Catalyst-Runtime.git] / t / live_stats.t
index ff7fca8..d47b50b 100644 (file)
@@ -1,14 +1,19 @@
-#!perl
-
 use strict;
 use warnings;
 
 use FindBin;
 use lib "$FindBin::Bin/lib";
 
-use Test::More tests => 5;
+use Test::More;
 use Catalyst::Test 'TestAppStats';
 
+if ( $ENV{CATALYST_SERVER} ) {
+    plan skip_all => 'Using remote server';
+}
+else {
+    plan tests => 5;
+}
+
 {
     ok( my $response = request('http://localhost/'), 'Request' );
     ok( $response->is_success, 'Response Successful 2xx' );
@@ -16,7 +21,7 @@ use Catalyst::Test 'TestAppStats';
 {
     ok( my $response = request('http://localhost/'), 'Request' );
     ok( $response->is_success, 'Response Successful 2xx' );
-    ok( $response->content =~ m/\/default.*?[\d.]+s.*- test.*[\d.]+s/s, 'Stats report');
+    like( $response->content, qr/\/default.*?[\d.]+s.*- test.*[\d.]+s/s, 'Stats report');
 
 }