[Bps-public-commit] Config-GitLike branch, master, updated. ed8c7444497593db5a939827d9656b683847d9e5

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Aug 11 04:16:22 EDT 2009


The branch, master has been updated
       via  ed8c7444497593db5a939827d9656b683847d9e5 (commit)
      from  d087f2ba729754421f6484d8fc0e17b40c7b13d1 (commit)

Summary of changes:
 Makefile.PL           |    2 +-
 t/t1300-repo-config.t |   15 +++++++--------
 2 files changed, 8 insertions(+), 9 deletions(-)

- Log -----------------------------------------------------------------
commit ed8c7444497593db5a939827d9656b683847d9e5
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Aug 11 16:15:16 2009 +0800

    replace File::Temp->newdir with an older one: tempdir

diff --git a/Makefile.PL b/Makefile.PL
index 58a008b..4e16751 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -9,7 +9,7 @@ requires 'Regexp::Common';
 build_requires 'Test::More';
 build_requires 'Test::Exception';
 build_requires 'File::Spec';
-build_requires 'File::Temp' => '0.19';
+build_requires 'File::Temp';
 extra_tests();
 sign();
 WriteAll();
diff --git a/t/t1300-repo-config.t b/t/t1300-repo-config.t
index af9cdc0..f556285 100644
--- a/t/t1300-repo-config.t
+++ b/t/t1300-repo-config.t
@@ -5,7 +5,7 @@ use File::Copy;
 use Test::More tests => 133;
 use Test::Exception;
 use File::Spec;
-use File::Temp;
+use File::Temp qw/tempdir/;
 use lib 't/lib';
 use TestConfig;
 
@@ -32,8 +32,7 @@ sub burp {
 }
 
 # create an empty test directory in /tmp
-my $config_dir = File::Temp->newdir( CLEANUP => !$ENV{CONFIG_GITLIKE_DEBUG} );
-my $config_dirname = $config_dir->dirname;
+my $config_dirname = tempdir( CLEANUP => !$ENV{CONFIG_GITLIKE_DEBUG} );
 my $config_filename = File::Spec->catfile( $config_dirname, 'config' );
 
 diag "config file is: $config_filename" if $ENV{TEST_VERBOSE};
@@ -177,7 +176,7 @@ haha = hello
 '
 );
 
-my $config2_filename = File::Spec->catfile( $config_dir, '.config2' );
+my $config2_filename = File::Spec->catfile( $config_dirname, '.config2' );
 
 copy( $config_filename, $config2_filename )
     or die "File cannot be copied: $!";
@@ -1067,8 +1066,8 @@ $config->load;
 is( $config->dump, $expect, 'value continued on next line' );
 
 # testing symlinked configuration
-symlink File::Spec->catfile( $config_dir, 'notyet' ),
-    File::Spec->catfile( $config_dir, 'myconfig' );
+symlink File::Spec->catfile( $config_dirname, 'notyet' ),
+    File::Spec->catfile( $config_dirname, 'myconfig' );
 
 my $myconfig = TestConfig->new(
     confname => 'myconfig',
@@ -1077,7 +1076,7 @@ my $myconfig = TestConfig->new(
 $myconfig->set(
     key      => 'test.frotz',
     value    => 'nitfol',
-    filename => File::Spec->catfile( $config_dir, 'myconfig' )
+    filename => File::Spec->catfile( $config_dirname, 'myconfig' )
 );
 my $notyet = TestConfig->new(
     confname => 'notyet',
@@ -1086,7 +1085,7 @@ my $notyet = TestConfig->new(
 $notyet->set(
     key      => 'test.xyzzy',
     value    => 'rezrov',
-    filename => File::Spec->catfile( $config_dir, 'notyet' )
+    filename => File::Spec->catfile( $config_dirname, 'notyet' )
 );
 $notyet->load;
 is( $notyet->get( key => 'test.frotz' ),

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list