summaryrefslogtreecommitdiff
path: root/spec/unit/provider/link_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/provider/link_spec.rb')
-rw-r--r--spec/unit/provider/link_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/unit/provider/link_spec.rb b/spec/unit/provider/link_spec.rb
index ab5b439eac..0f95ce997e 100644
--- a/spec/unit/provider/link_spec.rb
+++ b/spec/unit/provider/link_spec.rb
@@ -38,8 +38,8 @@ describe Chef::Resource::Link, :not_supported_on_win2k3 do
result
end
- def paths_eql?(path1, path2)
- Chef::Util::PathHelper.paths_eql?(path1, path2)
+ def canonicalize(path)
+ Chef::Platform.windows? ? path.gsub('/', '\\') : path
end
describe "when the target is a symlink" do
@@ -68,7 +68,7 @@ describe Chef::Resource::Link, :not_supported_on_win2k3 do
expect(provider.current_resource.link_type).to eq(:symbolic)
end
it "should update the source of the existing link with the links target" do
- expect(paths_eql?(provider.current_resource.to, "#{CHEF_SPEC_DATA}/fofile")).to be_truthy
+ expect(provider.current_resource.to).to eq(canonicalize("#{CHEF_SPEC_DATA}/fofile"))
end
it "should set the owner" do
expect(provider.current_resource.owner).to eq(501)
@@ -110,7 +110,7 @@ describe Chef::Resource::Link, :not_supported_on_win2k3 do
expect(provider.current_resource.link_type).to eq(:symbolic)
end
it "should update the source of the existing link to the link's target" do
- expect(paths_eql?(provider.current_resource.to, "#{CHEF_SPEC_DATA}/fofile")).to be_truthy
+ expect(provider.current_resource.to).to eq(canonicalize("#{CHEF_SPEC_DATA}/fofile"))
end
it "should not set the owner" do
expect(provider.current_resource.owner).to be_nil
@@ -221,7 +221,7 @@ describe Chef::Resource::Link, :not_supported_on_win2k3 do
expect(provider.current_resource.link_type).to eq(:hard)
end
it "should update the source of the existing link to the link's target" do
- expect(paths_eql?(provider.current_resource.to, "#{CHEF_SPEC_DATA}/fofile")).to be_truthy
+ expect(provider.current_resource.to).to eq(canonicalize("#{CHEF_SPEC_DATA}/fofile"))
end
it "should not set the owner" do
expect(provider.current_resource.owner).to eq(nil)