diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-05-15 07:35:23 -0700 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-05-15 07:35:23 -0700 |
commit | 4c73a841e018057302b7c0cb10f8f880c282d849 (patch) | |
tree | c2b705be377931d34ec2765585a7cf88efc3d733 | |
parent | 99fb657932382bfe1b8c78241690d46ab3782c76 (diff) | |
download | chef-4c73a841e018057302b7c0cb10f8f880c282d849.tar.gz |
Use canonical_path in windows_package resource for sourcejdm/msi-uri-source
-rw-r--r-- | lib/chef/resource/windows_package.rb | 2 | ||||
-rw-r--r-- | spec/unit/resource/windows_package_spec.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/resource/windows_package.rb b/lib/chef/resource/windows_package.rb index e900619100..d4f8ae0603 100644 --- a/lib/chef/resource/windows_package.rb +++ b/lib/chef/resource/windows_package.rb @@ -74,7 +74,7 @@ class Chef if uri_scheme?(arg) @source = arg else - @source = ::File.absolute_path(arg).gsub(::File::SEPARATOR, ::File::ALT_SEPARATOR) + @source = Chef::Util::PathHelper.canonical_path(arg, false) end end end diff --git a/spec/unit/resource/windows_package_spec.rb b/spec/unit/resource/windows_package_spec.rb index 094a678cf6..6aa5d357ea 100644 --- a/spec/unit/resource/windows_package_spec.rb +++ b/spec/unit/resource/windows_package_spec.rb @@ -63,9 +63,9 @@ describe Chef::Resource::WindowsPackage, "initialize" do end it "coverts a source to an absolute path" do - allow(::File).to receive(:absolute_path).and_return("c:\\Files\\frost.msi") + allow(::File).to receive(:absolute_path).and_return("c:\\files\\frost.msi") resource.source("frost.msi") - expect(resource.source).to eql "c:\\Files\\frost.msi" + expect(resource.source).to eql "c:\\files\\frost.msi" end it "converts slashes to backslashes in the source path" do |