Skip to content

Commit

Permalink
Item9312: Make test conditional (oops) .. and fix TemplateTests to use
Browse files Browse the repository at this point in the history
a temporary directory instead of cwd.

git-svn-id: http://svn.foswiki.org/trunk@8151 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Jul 13, 2010
1 parent 08ad867 commit 56173ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion UnitTestContrib/lib/Unit/TestRunner.pm
Expand Up @@ -130,7 +130,7 @@ sub start {
$action = runOne( $tester, $suite, $testToRun );
}

die "CWD changed to " . Cwd->cwd() . " by previous test!! \n" ;#if ( Cwd->cwd() ne $start_cwd) ;
die "CWD changed to " . Cwd->cwd() . " by previous test!! \n" if ( Cwd->cwd() ne $start_cwd) ;

# untaint action for the case where the test is run in
# another process
Expand Down
8 changes: 5 additions & 3 deletions UnitTestContrib/test/unit/TemplatesTests.pm
Expand Up @@ -28,7 +28,10 @@ sub set_up {
my $this = shift;
$this->SUPER::set_up();

my $here = Cwd::cwd();
$this->{tempdir} = $Foswiki::cfg{TempfileDir} . '/test_TemplateTests';
mkpath( $this->{tempdir} );

my $here = $this->{tempdir};
$here =~ m/^(.*)$/;
$test_tmpls = $1 . '/fake_templates';
$test_data = $1 . '/fake_data';
Expand All @@ -54,8 +57,7 @@ sub tear_down {
my $this = shift;
$session->finish();
$this->SUPER::tear_down();
File::Path::rmtree($test_tmpls);
File::Path::rmtree($test_data);
rmtree( $this->{tempdir} ); # Cleanup any old tests
}

sub write_template {
Expand Down

0 comments on commit 56173ab

Please sign in to comment.