Checking in changes prior to tagging of version 0.8. Changelog diff is: Test-NoTabs-0.8
Tomas Doran [Wed, 4 Feb 2009 13:30:22 +0000 (13:30 +0000)]
Changes
lib/Test/NoTabs.pm
t/12-fail.t

diff --git a/Changes b/Changes
index 94f20c0..33d68e0 100644 (file)
--- a/Changes
+++ b/Changes
@@ -25,3 +25,8 @@ Revision history for Test-NoTabs
 
 0.7  2009-01-06
      - Stop tests dumping files in temporary directory
+
+0.8  2009-02-04
+     - Fix tests to not open the same file 2 times at once,
+       as this doesn't work on Win32 and causes CPANTS fails.
+
index 83fd59a..c550e68 100644 (file)
@@ -10,7 +10,7 @@ use File::Find;
 
 use vars qw( $VERSION $PERL $UNTAINT_PATTERN $PERL_PATTERN);
 
-$VERSION = '0.7';
+$VERSION = '0.8';
 
 $PERL    = $^X || 'perl';
 $UNTAINT_PATTERN  = qr|^([-+@\w./:\\]+)$|;
index b123f91..a4729c3 100644 (file)
@@ -10,9 +10,10 @@ $inc = "-I $inc" if $inc;
 
 {
     my $dir = make_bad_file_1();
-    my ($fh, $outfile) = tempfile();
+    my (undef, $outfile) = tempfile();
     ok( `$perl $inc -MTest::NoTabs -e "all_perl_files_ok( '$dir' )" 2>&1 > $outfile` );
     local $/ = undef;
+    open my $fh, '<', $outfile or die $!;
     my $content = <$fh>;
     like( $content, qr/^not ok 1 - Found tabs in '[^']*' on line 4/m, 'tabs found in tmp file 1' );
     unlink $outfile;
@@ -21,8 +22,9 @@ $inc = "-I $inc" if $inc;
 
 {
     my $dir = make_bad_file_2();
-    my ($fh, $outfile) = tempfile();
+    my (undef, $outfile) = tempfile();
     ok( `$perl $inc -MTest::NoTabs -e "all_perl_files_ok( '$dir' )" 2>&1 > $outfile` );
+    open my $fh, '<', $outfile or die $!;
     local $/ = undef;
     my $content = <$fh>;
     like( $content, qr/^not ok 1 - Found tabs in '[^']*' on line 12/m, 'tabs found in tmp file2 ' );
@@ -32,8 +34,9 @@ $inc = "-I $inc" if $inc;
 
 {
     my ($dir, $file) = make_bad_file_3();
-    my ($fh, $outfile) = tempfile();
+    my (undef, $outfile) = tempfile();
     ok( `$perl $inc -MTest::NoTabs -e "all_perl_files_ok( '$file' )" 2>&1 > $outfile` );
+    open my $fh, '<', $outfile or die $!;
     local $/ = undef;
     my $content = <$fh>;
     like( $content, qr/^not ok 1 - Found tabs in '[^']*' on line 6/m, 'tabs found in tmp file 3' );
@@ -93,6 +96,7 @@ sub new {
 __DATA__
 nick   gerakines       software engineer       22
 DUMMY
+  close $fh;
   return ($tmpdir, $filename);
 }