spec/unit/berkshelf/downloader_spec.rb in berkshelf-6.3.4 vs spec/unit/berkshelf/downloader_spec.rb in berkshelf-7.0.0
- old
+ new
@@ -84,29 +84,24 @@
end
describe "chef_server location type" do
let(:chef_server_url) { "http://configured-chef-server/" }
let(:ridley_client) do
- double(Ridley::Client,
- cookbook: double("cookbook", download: "fake")
- )
+ instance_double(Berkshelf::RidleyCompat)
end
let(:chef_config) do
- double(Ridley::Chef::Config,
+ double(Berkshelf::ChefConfigCompat,
node_name: "fake-client",
client_key: "client-key",
chef_server_url: chef_server_url,
validation_client_name: "validator",
validation_key: "validator.pem",
artifactory_api_key: "secret",
cookbook_copyright: "user",
cookbook_email: "user@example.com",
cookbook_license: "apachev2",
- trusted_certs_dir: self_signed_crt_path,
- knife: {
- chef_guard: false,
- }
+ trusted_certs_dir: self_signed_crt_path
)
end
let(:berkshelf_config) do
double(Config,
@@ -131,11 +126,11 @@
ssl: {
verify: berkshelf_config.ssl.verify,
cert_store: cert_store,
},
}
- expect(Ridley).to receive(:open).with(credentials) { ridley_client }
+ expect(Berkshelf::RidleyCompat).to receive(:new_client).with(credentials) { ridley_client }
subject.try_download(source, name, version)
end
context "with a source option for client_name" do
before do
@@ -149,11 +144,11 @@
ssl: {
verify: berkshelf_config.ssl.verify,
cert_store: cert_store,
},
}
- expect(Ridley).to receive(:open).with(credentials) { ridley_client }
+ expect(Berkshelf::RidleyCompat).to receive(:new_client).with(credentials) { ridley_client }
subject.try_download(source, name, version)
end
end
context "with a source option for client_key" do
@@ -168,10 +163,10 @@
ssl: {
verify: berkshelf_config.ssl.verify,
cert_store: cert_store,
},
}
- expect(Ridley).to receive(:open).with(credentials) { ridley_client }
+ expect(Berkshelf::RidleyCompat).to receive(:new_client).with(credentials) { ridley_client }
subject.try_download(source, name, version)
end
end
end