diff options
Diffstat (limited to 'spec/unit/knife/cookbook_site_download_spec.rb')
-rw-r--r-- | spec/unit/knife/cookbook_site_download_spec.rb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/spec/unit/knife/cookbook_site_download_spec.rb b/spec/unit/knife/cookbook_site_download_spec.rb index 530ac576e0..663ad1af74 100644 --- a/spec/unit/knife/cookbook_site_download_spec.rb +++ b/spec/unit/knife/cookbook_site_download_spec.rb @@ -36,8 +36,8 @@ describe Chef::Knife::CookbookSiteDownload do allow(@knife.ui).to receive(:stderr).and_return(@stderr) allow(@knife).to receive(:noauth_rest).and_return(@noauth_rest) expect(@noauth_rest).to receive(:get). - with("#{@cookbook_api_url}/apache2"). - and_return(@current_data) + with("#{@cookbook_api_url}/apache2"). + and_return(@current_data) end context "when the cookbook is deprecated and not forced" do @@ -47,9 +47,9 @@ describe Chef::Knife::CookbookSiteDownload do it "should warn with info about the replacement" do expect(@knife.ui).to receive(:warn). - with(/.+deprecated.+replaced by other_apache2.+/i) + with(/.+deprecated.+replaced by other_apache2.+/i) expect(@knife.ui).to receive(:warn). - with(/use --force.+download.+/i) + with(/use --force.+download.+/i) @knife.run end end @@ -58,7 +58,7 @@ describe Chef::Knife::CookbookSiteDownload do before do @cookbook_data = { "version" => @version, "file" => "http://example.com/apache2_#{@version_us}.tgz" } - @temp_file = double( :path => "/tmp/apache2_#{@version_us}.tgz" ) + @temp_file = double( :path => "/tmp/apache2_#{@version_us}.tgz" ) @file = File.join(Dir.pwd, "apache2-#{@version}.tar.gz") expect(@noauth_rest).to receive(:sign_on_redirect=).with(false) @@ -67,11 +67,11 @@ describe Chef::Knife::CookbookSiteDownload do context "downloading the latest version" do before do expect(@noauth_rest).to receive(:get). - with(@current_data["latest_version"]). - and_return(@cookbook_data) + with(@current_data["latest_version"]). + and_return(@cookbook_data) expect(@noauth_rest).to receive(:get). - with(@cookbook_data["file"], true). - and_return(@temp_file) + with(@cookbook_data["file"], true). + and_return(@temp_file) end context "and it is deprecated and with --force" do @@ -82,7 +82,7 @@ describe Chef::Knife::CookbookSiteDownload do it "should download the latest version" do expect(@knife.ui).to receive(:warn). - with(/.+deprecated.+replaced by other_apache2.+/i) + with(/.+deprecated.+replaced by other_apache2.+/i) expect(FileUtils).to receive(:cp).with(@temp_file.path, @file) @knife.run expect(@stderr.string).to match /downloading apache2.+version.+#{Regexp.escape(@version)}/i @@ -132,11 +132,11 @@ describe Chef::Knife::CookbookSiteDownload do it "should download the desired version" do expect(@noauth_rest).to receive(:get). - with("#{@cookbook_api_url}/apache2/versions/#{@version_us}"). - and_return(@cookbook_data) + with("#{@cookbook_api_url}/apache2/versions/#{@version_us}"). + and_return(@cookbook_data) expect(@noauth_rest).to receive(:get). - with(@cookbook_data["file"], true). - and_return(@temp_file) + with(@cookbook_data["file"], true). + and_return(@temp_file) expect(FileUtils).to receive(:cp).with(@temp_file.path, @file) @knife.run expect(@stderr.string).to match /downloading apache2.+version.+#{Regexp.escape(@version)}/i |