spec/unit/berkshelf/downloader_spec.rb in berkshelf-1.0.0.rc1 vs spec/unit/berkshelf/downloader_spec.rb in berkshelf-1.0.0.rc2
- old
+ new
@@ -52,11 +52,11 @@
source.stub(:location).and_return(location)
location.should_receive(:download).with(subject.storage_path).and_return(cached_cookbook)
source.should_receive(:cached_cookbook=).with(cached_cookbook)
end
- it "sends 'download' to the source's location and sets the source's cached_cookbook to the result" do
+ it "sends 'download' to the source's location and sets the source's cached_cookbook to the result" do
subject.download(source).should be_true
end
it "returns an Array containing the cached_cookbook and location used to download" do
result = subject.download(source)
@@ -68,14 +68,14 @@
end
context "when the source does not have a location" do
before(:each) do
source.stub(:location).and_return(nil)
- subject.stub(:locations).and_return([{type: :chef_api, value: :knife, options: Hash.new}])
+ subject.stub(:locations).and_return([{type: :chef_api, value: :config, options: Hash.new}])
end
it "sends the 'download' message to the default location" do
- Location.should_receive(:init).with(source.name, source.version_constraint, chef_api: :knife).and_return(location)
+ Location.should_receive(:init).with(source.name, source.version_constraint, chef_api: :config).and_return(location)
location.should_receive(:download).with(subject.storage_path).and_return(cached_cookbook)
source.should_receive(:cached_cookbook=).with(cached_cookbook)
subject.download(source)
end