summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2016-02-09 14:01:12 -0800
committerThom May <thom@chef.io>2016-02-09 14:01:12 -0800
commitb4b91836f0b2f0e09e089acab43e410cd73e48a4 (patch)
treec6aadeaef06102b0f92d7bde5c0656191cba6b21 /spec
parent7755b93c72ef33d5041b6a9c4b53bcf29814579d (diff)
downloadchef-b4b91836f0b2f0e09e089acab43e410cd73e48a4.tar.gz
Use a streaming request to download cookbook
fixes #4549
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/knife/cookbook_site_download_spec.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/spec/unit/knife/cookbook_site_download_spec.rb b/spec/unit/knife/cookbook_site_download_spec.rb
index 663ad1af74..d7f26f2f2e 100644
--- a/spec/unit/knife/cookbook_site_download_spec.rb
+++ b/spec/unit/knife/cookbook_site_download_spec.rb
@@ -60,8 +60,6 @@ describe Chef::Knife::CookbookSiteDownload do
"file" => "http://example.com/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)
end
context "downloading the latest version" do
@@ -69,8 +67,8 @@ describe Chef::Knife::CookbookSiteDownload do
expect(@noauth_rest).to receive(:get).
with(@current_data["latest_version"]).
and_return(@cookbook_data)
- expect(@noauth_rest).to receive(:get).
- with(@cookbook_data["file"], true).
+ expect(@noauth_rest).to receive(:streaming_request).
+ with(@cookbook_data["file"]).
and_return(@temp_file)
end
@@ -134,8 +132,8 @@ describe Chef::Knife::CookbookSiteDownload do
expect(@noauth_rest).to receive(:get).
with("#{@cookbook_api_url}/apache2/versions/#{@version_us}").
and_return(@cookbook_data)
- expect(@noauth_rest).to receive(:get).
- with(@cookbook_data["file"], true).
+ expect(@noauth_rest).to receive(:streaming_request).
+ with(@cookbook_data["file"]).
and_return(@temp_file)
expect(FileUtils).to receive(:cp).with(@temp_file.path, @file)
@knife.run