Fix RT#52456 - skip tests if we don't have Encode
Tomas Doran [Tue, 9 Feb 2010 03:23:23 +0000 (03:23 +0000)]
Changes
t/05env.t

diff --git a/Changes b/Changes
index e0f195e..d7d84d3 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 This file documents the revision history for Perl extension HTTP::Request::AsCGI.
 
+    - Fixed tests on perl <= 5.6.2 by skipping if Encode is not installed.
+      (RT#52456)
+
 1.2 2010-01-12
     - Fixed the %ENV concatenation that's broken in 1.1 but wasn't shipped to CPAN (miyagawa)
     - REQUEST_URI is trying to replicate as raw values as possible, without being canonicalized (miyagawa)
index 49dd7bd..1ab9ab7 100644 (file)
--- a/t/05env.t
+++ b/t/05env.t
@@ -1,14 +1,21 @@
 #!perl
 
-use Test::More tests => 11;
+use Test::More;
 
 use strict;
 use warnings;
 
+BEGIN {
+    eval { require Encode }
+        or plan skip_all => 'This test requires Encode';
+}
+
 use HTTP::Request;
 use HTTP::Request::AsCGI;
 use Encode;
 
+plan tests => 11;
+
 $ENV{__PRESERVE_ENV_TEST} = 1;
 
 my $r = HTTP::Request->new( GET => 'http://www.host.com/cgi-bin/script.cgi/my%20path%2F?a=1&b=2', [ 'X-Test' => 'Test' ] );