summaryrefslogtreecommitdiff
path: root/spec/functional/resource
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2016-08-03 08:53:05 -0700
committerJohn Keiser <john@johnkeiser.com>2016-08-03 14:16:52 -0700
commitea3ccf9d95ef751e1f2efe1a645648e75e7add24 (patch)
tree2448697b8b4da94ee3169ea156fe0e8e2633a379 /spec/functional/resource
parentf34d47a1ffc29291c0ea9f544254ccaf0c9db319 (diff)
downloadchef-ea3ccf9d95ef751e1f2efe1a645648e75e7add24.tar.gz
Fix Ruby 2.3 `symlink?` when symlink points to nonexistent file
Diffstat (limited to 'spec/functional/resource')
-rw-r--r--spec/functional/resource/link_spec.rb7
1 files changed, 1 insertions, 6 deletions
diff --git a/spec/functional/resource/link_spec.rb b/spec/functional/resource/link_spec.rb
index 6dd6ad8422..5e58d0918a 100644
--- a/spec/functional/resource/link_spec.rb
+++ b/spec/functional/resource/link_spec.rb
@@ -580,12 +580,7 @@ describe Chef::Resource::Link do
it "links to the target file" do
skip("OS X/FreeBSD/AIX fails to create hardlinks to broken symlinks") if os_x? || freebsd? || aix?
resource.run_action(:create)
- # Windows and Unix have different definitions of exists? here, and that's OK.
- if windows?
- expect(File.exists?(target_file)).to be_truthy
- else
- expect(File.exists?(target_file)).to be_falsey
- end
+ expect(File.exists?(target_file) || File.symlink?(target_file)).to be_truthy
expect(symlink?(target_file)).to be_truthy
expect(readlink(target_file)).to eq(canonicalize(@other_target))
end