diff options
author | David Schmitt <david@dasz.at> | 2010-05-18 11:33:49 +0200 |
---|---|---|
committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
commit | 54c453853ddb1648af14b42dca6f827c5cb8e007 (patch) | |
tree | 1ecc38792dfba32e456addb12883857c80d8ce1c /spec | |
parent | 97c043f440115fcfd9d3ddaad59af5c8da875329 (diff) | |
download | puppet-54c453853ddb1648af14b42dca6f827c5cb8e007.tar.gz |
Delete tempfiles on win32
Diffstat (limited to 'spec')
-rw-r--r-- | spec/spec_helper.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 777a06721..8bc869dd6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -42,9 +42,16 @@ Spec::Runner.configure do |config| if defined?($tmpfiles) $tmpfiles.each do |file| - unless file.include?("/tmp") or file.include?("/var/folders") + file = File.expand_path(file) + if Puppet.features.posix? and file !~ /^\/tmp/ and file !~ /^\/var\/folders/ puts "Not deleting tmpfile #{file} outside of /tmp or /var/folders" next + elsif Puppet.features.win32? + tempdir = File.expand_path(File.join(Dir::LOCAL_APPDATA, "Temp")) + if file !~ /^#{tempdir}/ + puts "Not deleting tmpfile #{file} outside of #{tempdir}" + next + end end if FileTest.exist?(file) system("chmod -R 755 '#{file}'") |