Sha256: 9931283631599c33d2835632e0b422d574f533fe923b83050ec30467a6a1ac7b

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

base = File.dirname(__FILE__)
require base + '/../test_setup'

require 'rubygems'
require_gem 'FakeWeb'

context 'S33r list of all buckets' do
  setup do
    @client = Client.new(Testing::ACCESS_KEY, Testing::SECRET_ACCESS_KEY, :use_ssl => false, :dump_requests => true)

    xml_file = File.join(File.dirname(__FILE__), '../files/all_buckets.xml')
    @list_all_buckets_result = File.open(xml_file) { |f| f.read }
    
    listallbuckets_response = Net::HTTPResponse.new('1.1', '200', 'OK')
    listallbuckets_response.body = @list_all_buckets_result
    
    base_url = s3_url('/')
    FakeWeb.register_uri(base_url, :status => 200, :response => listallbuckets_response)
    FakeWeb.register_uri(base_url + 'elliotsmith-backup', :status => 200)
    FakeWeb.register_uri(base_url + 'elliotsmith-helloworld', :status => 200)
    FakeWeb.register_uri(base_url + 'elliotsmith-herbert', :status => 200)
  end
  
  specify 'should parse ListAllMyBucketsResult and get right number of buckets' do
    buckets = @client.list_buckets
    buckets.size.should.be 3
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
s33r-0.4.1 test/cases/spec_all_buckets.rb
s33r-0.4 test/cases/spec_all_buckets.rb
s33r-0.4.2 test/cases/spec_all_buckets.rb