summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraliasgar16 <aliasgar.batterywala@clogeny.com>2016-09-07 17:20:28 +0530
committeraliasgar16 <aliasgar.batterywala@clogeny.com>2016-09-07 17:20:28 +0530
commite71fdb195565c2e45c1992f6ab6c5123e3518072 (patch)
treec2ecad1e5a8009cbd76819337640cf29e92c8c3b
parent1b68b414eaf8e949162f2cc22854ae7d85ed4573 (diff)
downloadchef-e71fdb195565c2e45c1992f6ab6c5123e3518072.tar.gz
Added functional RSpecs for the fix added here for symlink issue on windows.
-rw-r--r--spec/functional/resource/link_spec.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/functional/resource/link_spec.rb b/spec/functional/resource/link_spec.rb
index 5e58d0918a..de6976448e 100644
--- a/spec/functional/resource/link_spec.rb
+++ b/spec/functional/resource/link_spec.rb
@@ -388,6 +388,14 @@ describe Chef::Resource::Link do
symlink(other_dir, target_file)
end
include_context "create symbolic link succeeds"
+ include_context "delete succeeds"
+ end
+ context "and the link already exists and points at the target" do
+ before do
+ symlink(to, target_file)
+ end
+ include_context "create symbolic link is noop"
+ include_context "delete succeeds"
end
end
context "when the link destination is a symbolic link" do
@@ -406,6 +414,19 @@ describe Chef::Resource::Link do
include_context "create symbolic link succeeds"
include_context "delete is noop"
end
+ context "and the destination itself has another symbolic link" do
+ context "to a link that exist" do
+ before do
+ symlink(to, target_file)
+ end
+ include_context "create symbolic link is noop"
+ include_context "delete succeeds"
+ end
+ context "to a link that does not exist" do
+ include_context "create symbolic link succeeds"
+ include_context "delete is noop"
+ end
+ end
end
context "to a file that does not exist" do
before(:each) do
@@ -418,6 +439,19 @@ describe Chef::Resource::Link do
include_context "create symbolic link succeeds"
include_context "delete is noop"
end
+ context "and the destination itself has another symbolic link" do
+ context "to a link that exist" do
+ before do
+ symlink(to, target_file)
+ end
+ include_context "create symbolic link is noop"
+ include_context "delete succeeds"
+ end
+ context "to a link that does not exist" do
+ include_context "create symbolic link succeeds"
+ include_context "delete is noop"
+ end
+ end
end
end
context "when the link destination does not exist" do