diff options
Diffstat (limited to 'spec/lib/puppet_spec/files.rb')
-rwxr-xr-x | spec/lib/puppet_spec/files.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/lib/puppet_spec/files.rb b/spec/lib/puppet_spec/files.rb index 30fb4fc42..9e75d3142 100755 --- a/spec/lib/puppet_spec/files.rb +++ b/spec/lib/puppet_spec/files.rb @@ -31,6 +31,16 @@ module PuppetSpec::Files end end + def make_absolute(path) + return path unless Puppet.features.microsoft_windows? + # REMIND UNC + return path if path =~ /^[A-Za-z]:/ + + pwd = Dir.getwd + return "#{pwd[0,2]}#{path}" if pwd.length > 2 and pwd =~ /^[A-Za-z]:/ + return "C:#{path}" + end + def tmpfile(name) # Generate a temporary file, just for the name... source = Tempfile.new(name) |