Skip to content
This repository has been archived by the owner on May 14, 2019. It is now read-only.

Commit

Permalink
TMP testing directory should only be cleaned up when testing the core…
Browse files Browse the repository at this point in the history
… after cleaning up the global tmp dir.
  • Loading branch information
bermi committed Jun 19, 2011
1 parent ce02c7c commit fa34833
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions active_support/testing/suite.php
Expand Up @@ -221,15 +221,15 @@ static function ensureTmpDirPermissions(){
}

static function cleanupTmpDir() {

if(strstr(AK_BASE_DIR, AK_TMP_DIR)){
return;
}

clearstatcache();
$files = glob(AK_TMP_DIR.DS.'*');
$files = array_diff($files, array(''));

$framework_testing_tmp = AK_FRAMEWORK_DIR.DS.'app_layout'.DS.'tmp'.DS.'testing';
if(is_dir($framework_testing_tmp)){
AkFileSystem::directory_delete($framework_testing_tmp);
}

foreach ($files as $file){
if(!is_dir($file)){
if($file != '.gitignore'){
Expand All @@ -239,6 +239,11 @@ static function cleanupTmpDir() {
AkFileSystem::rmdir_tree($file);
}
}

$framework_testing_tmp = AK_FRAMEWORK_DIR.DS.'app_layout'.DS.'tmp'.DS.'testing'.DS.'web';
if(is_dir($framework_testing_tmp)){
AkFileSystem::directory_delete($framework_testing_tmp);
}
}

public function log($message) {
Expand Down

0 comments on commit fa34833

Please sign in to comment.