Permalink
Browse files

fixed broken specs (which only run when creds are supplied)

  • Loading branch information...
smessier committed Oct 22, 2011
1 parent 2fa72bf commit 746ffcabec353b31aab3394895b1b7f26dc6168a
Showing with 14 additions and 10 deletions.
  1. +7 −5 spec/cookbook_s3_upload_spec.rb
  2. +7 −5 spec/svn/retriever_spec.rb
@@ -83,10 +83,11 @@ def delete_download_repo
bucket_name = 'this-bucket-does-not-exist'
@s3.bucket(bucket_name).should be_nil
lambda {
- @scraper = @scraperclass.new(:repo_dir => @download_repo_path,
+ @scraper = @scraperclass.new(:repository => @repo,
+ :repo_dir => @download_repo_path,
:scanners => [RightScraper::Scanners::CookbookMetadata,
RightScraper::Scanners::CookbookManifest,
- RightScraper::Scanners::S3Upload],
+ RightScraper::Scanners::CookbookS3Upload],
:s3_key => ENV['AMAZON_ACCESS_KEY_ID'],
:s3_secret => ENV['AMAZON_SECRET_ACCESS_KEY'],
:s3_bucket => bucket_name,
@@ -106,10 +107,11 @@ def delete_download_repo
:repo_type => :download,
:url => "file:///#{@download_file}")
bucket_name = 'com.rightscale.test.20100823'
- @scraper = @scraperclass.new(:repo_dir => @download_repo_path,
+ @scraper = @scraperclass.new(:repository => @repo,
+ :repo_dir => @download_repo_path,
:scanners => [RightScraper::Scanners::CookbookMetadata,
RightScraper::Scanners::CookbookManifest,
- RightScraper::Scanners::S3Upload],
+ RightScraper::Scanners::CookbookS3Upload],
:s3_key => ENV['AMAZON_ACCESS_KEY_ID'],
:s3_secret => ENV['AMAZON_SECRET_ACCESS_KEY'],
:s3_bucket => bucket_name,
@@ -128,7 +130,7 @@ def delete_download_repo
context 'that has scraped' do
before(:each) do
- @cookbook = @scraper.next
+ @cookbook = @scraper.next_resource
@cookbook.should_not be_nil
end
View
@@ -40,12 +40,14 @@
before(:each) do
pending "Not run unless REMOTE_USER and REMOTE_PASSWORD set" unless ENV['REMOTE_USER'] && ENV['REMOTE_PASSWORD']
url = 'https://wush.net/svn/rightscale/cookbooks_test/'
+ @helper = RightScraper::SvnRetrieverSpecHelper.new
@repo = RightScraper::Repositories::Base.from_hash(:display_name => 'wush',
:repo_type => :svn,
:url => url,
:first_credential => ENV['REMOTE_USER'],
:second_credential => ENV['REMOTE_PASSWORD'])
@retriever = @retriever_class.new(@repo, :max_bytes => 1024**2,
+ :basedir => @helper.scraper_path,
:max_seconds => 20)
end
@@ -61,17 +63,17 @@
# quick_start not actually being a cookbook
it 'should scrape 5 repositories' do
+ @retriever.retrieve
+ @scraper = RightScraper::Scrapers::Base.scraper(:kind => :cookbook,
+ :ignorable_paths => @retriever.ignorable_paths,
+ :repo_dir => @retriever.repo_dir,
+ :repository => @retriever.repository)
locations = Set.new
(1..5).each {|n|
cookbook = @scraper.next_resource
locations << cookbook.pos
cookbook.should_not == nil
}
- @retriever.retrieve
- @scraper = RightScraper::Scrapers::Base.scraper(:kind => :cookbook,
- :ignorable_paths => @retriever.ignorable_paths,
- :repo_dir => @retriever.repo_dir,
- :repository => @retriever.repository)
@scraper.next_resource.should == nil
locations.should == Set.new(["cookbooks/app_rails",
"cookbooks/db_mysql",

0 comments on commit 746ffca

Please sign in to comment.