spec/unit/berkshelf/locations/git_location_spec.rb in berkshelf-1.4.1 vs spec/unit/berkshelf/locations/git_location_spec.rb in berkshelf-1.4.2
- old
+ new
@@ -42,13 +42,14 @@
subject.download(tmp_path).should be_a(Berkshelf::CachedCookbook)
end
it "downloads the cookbook to the given destination" do
cached_cookbook = subject.download(tmp_path)
+ branch_name = subject.branch_name
tmp_path.should have_structure {
- directory "#{cached_cookbook.cookbook_name}-#{Berkshelf::Git.rev_parse(cached_cookbook.path)}" do
+ directory "#{cached_cookbook.cookbook_name}-#{branch_name}" do
file "metadata.rb"
end
}
end
@@ -120,14 +121,12 @@
ref: ref
)
end
let(:cached_cookbook) { subject.download(tmp_path) }
let(:commit_hash) { "d7be334b094f497f5cce4169a8b3012bf7b27bc3" }
- let(:expected_path) { tmp_path.join("#{cached_cookbook.cookbook_name}-#{commit_hash}") }
+ let(:expected_path) { tmp_path.join("#{cached_cookbook.cookbook_name}-#{ref}") }
- before(:each) { Berkshelf::Git.should_receive(:rev_parse).and_return(commit_hash) }
-
- it "returns a cached cookbook with a path that contains the commit hash it is pointing to" do
+ it "returns a cached cookbook with a path that contains the ref and not the commit hash it is pointing to" do
cached_cookbook.path.should eql(expected_path)
end
end
end
end