diff options
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 |