spec/git/retriever_spec.rb in right_scraper-3.0.4 vs spec/git/retriever_spec.rb in right_scraper-3.2.3
- old
+ new
@@ -21,11 +21,10 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++
require File.expand_path(File.join(File.dirname(__FILE__), 'retriever_spec_helper'))
require 'set'
-require 'libarchive_ruby'
describe RightScraper::Retrievers::Git do
include RightScraper::SpecHelpers::DevelopmentModeEnvironment
include RightScraper::ScraperHelper
@@ -204,12 +203,12 @@
end
end
context 'with a subcookbook' do
before(:each) do
- subdir = File.join(@helper.repo_path, "cookbook")
- secondary_cookbook(subdir)
+ @subdir = File.join(@helper.repo_path, "cookbook")
+ secondary_cookbook(@subdir)
@helper.commit_content("subcookbook added")
end
include RightScraper::SpecHelpers::FromScratchScraping
include RightScraper::SpecHelpers::CookbookScraping
@@ -219,11 +218,12 @@
@scraper.next_resource.should == nil
end
it 'should have the subcookbook in the manifest' do
cookbook = @scraper.next_resource
- cookbook.manifest["cookbook/metadata.json"].should == "c2901d21c81ba5a152a37a5cfae35a8e092f7b39"
+ contents = ::File.read(::File.join(@subdir, "metadata.json"))
+ cookbook.manifest["cookbook/metadata.json"].should == ::Digest::MD5.hexdigest(contents)
end
end
context 'with multiple cookbooks' do
before(:each) do
@@ -333,10 +333,10 @@
before(:each) do
@scraper = get_scraper(@repo, @helper.scraper_path)
end
after(:each) do
- @scraper.close
+ @scraper.close if @scraper
@scraper = nil
end
it 'the scraper should store intermediate versions where we expect' do
@scraper.send(:repo_dir).should begin_with @helper.scraper_path