diff options
Diffstat (limited to 'spec/functional/resource/link_spec.rb')
-rw-r--r-- | spec/functional/resource/link_spec.rb | 34 |
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 |