diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-08-11 13:30:10 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-08-12 14:02:34 -0700 |
commit | 4848c89b7cc5e4a4d4fac7c8bff962f7df69f719 (patch) | |
tree | cf1bc6d0b30f226573da88158049f1334b6ce1bd /spec/unit/knife/cookbook_download_spec.rb | |
parent | 798cac61accc035b51aaac25160bf1d5e9715252 (diff) | |
download | chef-exist.tar.gz |
File.exists? -> File.exist?exist
Update some of these methods
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/unit/knife/cookbook_download_spec.rb')
-rw-r--r-- | spec/unit/knife/cookbook_download_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/unit/knife/cookbook_download_spec.rb b/spec/unit/knife/cookbook_download_spec.rb index 2d1d70cb51..62b6e58c75 100644 --- a/spec/unit/knife/cookbook_download_spec.rb +++ b/spec/unit/knife/cookbook_download_spec.rb @@ -94,7 +94,7 @@ describe Chef::Knife::CookbookDownload do let(:manifest_data) { { all_files: [] } } it "should determine which version to download" do expect(@knife).to receive(:determine_version).and_return("1.0.0") - expect(File).to receive(:exists?).with("/var/tmp/chef/foobar-1.0.0").and_return(false) + expect(File).to receive(:exist?).with("/var/tmp/chef/foobar-1.0.0").and_return(false) @knife.run end end @@ -111,7 +111,7 @@ describe Chef::Knife::CookbookDownload do end it "should print an error and exit if the cookbook download directory already exists" do - expect(File).to receive(:exists?).with("/var/tmp/chef/foobar-1.0.0").and_return(true) + expect(File).to receive(:exist?).with("/var/tmp/chef/foobar-1.0.0").and_return(true) expect(@knife.ui).to receive(:fatal).with(%r{/var/tmp/chef/foobar-1\.0\.0 exists}i) expect { @knife.run }.to raise_error(SystemExit) end @@ -135,7 +135,7 @@ describe Chef::Knife::CookbookDownload do end it "should download the cookbook when the cookbook download directory doesn't exist" do - expect(File).to receive(:exists?).with("/var/tmp/chef/foobar-1.0.0").and_return(false) + expect(File).to receive(:exist?).with("/var/tmp/chef/foobar-1.0.0").and_return(false) @knife.run %w{attributes recipes templates}.each do |segment| expect(@stderr.string).to match /downloading #{segment}/im @@ -147,7 +147,7 @@ describe Chef::Knife::CookbookDownload do describe "with -f or --force" do it "should remove the existing the cookbook download directory if it exists" do @knife.config[:force] = true - expect(File).to receive(:exists?).with("/var/tmp/chef/foobar-1.0.0").and_return(true) + expect(File).to receive(:exist?).with("/var/tmp/chef/foobar-1.0.0").and_return(true) expect(FileUtils).to receive(:rm_rf).with("/var/tmp/chef/foobar-1.0.0") @knife.run end |