diff options
author | Tim Smith <tsmith84@gmail.com> | 2021-01-26 08:21:19 -0800 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2021-02-02 11:50:43 -0800 |
commit | 5a2bab642653a715cd73be1f04062e37322b82a7 (patch) | |
tree | 0628a51dc69dfb2733bec04d612d065141192273 /spec | |
parent | 96e1f6d3f52e0ce6e66087ede8b65bf342154a26 (diff) | |
download | chef-5a2bab642653a715cd73be1f04062e37322b82a7.tar.gz |
Replace deprecated File.exists? with File.exist? in more placesfile_exists
Just some boring cleanup
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/dsl/reboot_pending_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/spec/unit/dsl/reboot_pending_spec.rb b/spec/unit/dsl/reboot_pending_spec.rb index 4fed3be442..3ad1be9e38 100644 --- a/spec/unit/dsl/reboot_pending_spec.rb +++ b/spec/unit/dsl/reboot_pending_spec.rb @@ -57,12 +57,12 @@ describe Chef::DSL::RebootPending do end it "should return true if /var/run/reboot-required exists" do - allow(File).to receive(:exists?).with("/var/run/reboot-required").and_return(true) + allow(File).to receive(:exist?).with("/var/run/reboot-required").and_return(true) expect(recipe.reboot_pending?).to be_truthy end it "should return false if /var/run/reboot-required does not exist" do - allow(File).to receive(:exists?).with("/var/run/reboot-required").and_return(false) + allow(File).to receive(:exist?).with("/var/run/reboot-required").and_return(false) expect(recipe.reboot_pending?).to be_falsey end end diff --git a/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb b/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb index 9d8fb050da..6693eded03 100644 --- a/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb +++ b/spec/unit/formatters/error_inspectors/resource_failure_inspector_spec.rb @@ -115,7 +115,7 @@ describe Chef::Formatters::ErrorInspectors::ResourceFailureInspector do # fake code to run through #recipe_snippet source_file = [ "if true", "var = non_existent", "end" ] allow(IO).to receive(:readlines).and_return(source_file) - allow(File).to receive(:exists?).and_return(true) + allow(File).to receive(:exist?).and_return(true) end it "parses a Windows path" do @@ -141,7 +141,7 @@ describe Chef::Formatters::ErrorInspectors::ResourceFailureInspector do context "when the recipe file does not exist" do before do - allow(File).to receive(:exists?).and_return(false) + allow(File).to receive(:exist?).and_return(false) allow(IO).to receive(:readlines).and_raise(Errno::ENOENT) end |