diff options
author | Tim Smith <tsmith@chef.io> | 2021-02-02 12:08:50 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-02 12:08:50 -0800 |
commit | adacfa3e5a45a3a1a7783108b416db626c2e8faa (patch) | |
tree | 984eccb315368e11ae74278b56cff7e46b020b92 /spec | |
parent | ff0fbe614a9a96418b5dd57b5494b068c9ea55cf (diff) | |
parent | 5a2bab642653a715cd73be1f04062e37322b82a7 (diff) | |
download | chef-adacfa3e5a45a3a1a7783108b416db626c2e8faa.tar.gz |
Merge pull request #10966 from chef/file_exists
Replace deprecated File.exists? with File.exist? in more places
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 |