1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
From: Jason Barnett <jason.w.barnett@gmail.com>
Date: Tue, 30 May 2023 13:51:11 -0600
Subject: update ::File.exists? to ::File.exist?
This is a backport of
https://github.com/chef/chef/commit/5ab62efe29f632dd5d5f22f90db0f352f43cdf94
excluding the bits not related to chef-config.
Signed-off-by: Antonio Terceiro <terceiro@debian.org>
Signed-off-by: Jason Barnett <jason.w.barnett@gmail.com>
---
spec/unit/config_spec.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb
index 3d73659..d4761ff 100644
--- a/spec/unit/config_spec.rb
+++ b/spec/unit/config_spec.rb
@@ -516,7 +516,7 @@ RSpec.describe ChefConfig::Config do
context "when /var/chef does not exist and /var is accessible" do
it "defaults to /var/chef" do
- allow(File).to receive(:exists?).with(ChefConfig::Config.var_chef_dir).and_return(false)
+ allow(File).to receive(:exist?).with(ChefConfig::Config.var_chef_dir).and_return(false)
allow(ChefConfig::Config).to receive(:path_accessible?).with(ChefConfig::Config.var_root_dir).and_return(true)
expect(ChefConfig::Config[:cache_path]).to eq(primary_cache_path)
end
@@ -524,7 +524,7 @@ RSpec.describe ChefConfig::Config do
context "when /var/chef does not exist and /var is not accessible" do
it "defaults to $HOME/.chef" do
- allow(File).to receive(:exists?).with(ChefConfig::Config.var_chef_dir).and_return(false)
+ allow(File).to receive(:exist?).with(ChefConfig::Config.var_chef_dir).and_return(false)
allow(ChefConfig::Config).to receive(:path_accessible?).with(ChefConfig::Config.var_root_dir).and_return(false)
expect(ChefConfig::Config[:cache_path]).to eq(secondary_cache_path)
end
@@ -532,7 +532,7 @@ RSpec.describe ChefConfig::Config do
context "when /var/chef exists and is not accessible" do
before do
- allow(File).to receive(:exists?).with(ChefConfig::Config.var_chef_dir).and_return(true)
+ allow(File).to receive(:exist?).with(ChefConfig::Config.var_chef_dir).and_return(true)
allow(File).to receive(:readable?).with(ChefConfig::Config.var_chef_dir).and_return(true)
allow(File).to receive(:writable?).with(ChefConfig::Config.var_chef_dir).and_return(false)
end
|