diff options
author | Phil Dibowitz <phil@ipom.com> | 2019-04-25 11:11:10 -0700 |
---|---|---|
committer | Phil Dibowitz <phil@ipom.com> | 2019-04-29 11:16:20 -0700 |
commit | 9ea76290936316ce6fe2d40621581210b2006572 (patch) | |
tree | 1a8c9d00ea427a307f1c955d27581edfa9c59498 /spec/support | |
parent | da8bc7a3a5bad59fe5f228d7d0c272ea1e2c469b (diff) | |
download | chef-9ea76290936316ce6fe2d40621581210b2006572.tar.gz |
Tell people what file a link is pointing at.
In the event you are managing a file `/etc/file` with a `file` resource,
but it turns out to be a link to `/etc/passwd` and you are trying to figure
out what overwrite `/etc/passwd`, there is no indication in the logs. Let's add
one.
Signed-off-by: Phil Dibowitz <phil@ipom.com>
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/shared/unit/provider/file.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/spec/support/shared/unit/provider/file.rb b/spec/support/shared/unit/provider/file.rb index a7c7af92f6..b3039f9be4 100644 --- a/spec/support/shared/unit/provider/file.rb +++ b/spec/support/shared/unit/provider/file.rb @@ -76,6 +76,7 @@ def setup_symlink allow(File).to receive(:directory?).with(path).and_return(false) allow(File).to receive(:writable?).with(path).and_return(true) allow(file_symlink_class).to receive(:symlink?).with(path).and_return(true) + allow(file_symlink_class).to receive(:realpath).with(path).and_return(path) end allow(File).to receive(:directory?).with(enclosing_directory).and_return(true) end |