spec/git/cookbook_spec.rb in right_scraper-3.0.4 vs spec/git/cookbook_spec.rb in right_scraper-3.2.3
- old
+ new
@@ -74,11 +74,11 @@
retriever = @repository.retriever(:basedir => @tmpdir)
retriever.retrieve
ensure
FileUtils.remove_entry_secure(@tmpdir)
end
- }.should raise_exception(ProcessWatcher::NonzeroExitCode)
+ }.should raise_exception(::RightScraper::Processes::SSHAgent::SSHAgentError, /Attempted to use credentials that require passwords; bailing/)
ENV['SSH_AGENT_PID'].should == oldpid
end
end
context 'with an invalid git repository with a real credential' do
@@ -122,28 +122,27 @@
it 'should have a tag' do
@repository.tag.should == "master"
end
it 'should have a cookbook hash' do
- repo_hash = Digest::SHA1.hexdigest("1\000git\000http://a.site/foo/bar/baz\000master")
example_cookbook(@repository).resource_hash.should ==
- Digest::SHA1.hexdigest("1\000#{repo_hash}\000")
+ Digest::MD5.hexdigest(RightScraper::Resources::Cookbook::EMPTY_MANIFEST_JSON)
end
it 'should have a cookbook hash invariant under credential changes' do
old_hash = example_cookbook(@repository).resource_hash
@repository.first_credential = "b-key"
example_cookbook(@repository).resource_hash.should == old_hash
end
- it 'should have a cookbook hash that varies when the tag changes' do
+ it 'should have a cookbook hash invariant under tag changes' do
old_hash = example_cookbook(@repository).resource_hash
@repository.tag = "tag"
- example_cookbook(@repository).resource_hash.should_not == old_hash
+ example_cookbook(@repository).resource_hash.should == old_hash
end
- it 'should have a cookbook hash that varies when the position changes' do
- example_cookbook(@repository, "foo").resource_hash.should_not ==
+ it 'should have a cookbook hash invariant under position changes' do
+ example_cookbook(@repository, "foo").resource_hash.should ==
example_cookbook(@repository, "bar").resource_hash
end
end
context 'with a git repository with a tag' do
before(:each) do