Sha256: ba2a7b2ec58ffe9b30dfcb5e4226ee2cfef4a73293b9e536f31de33b2dc58375

Contents?: true

Size: 1.49 KB

Versions: 30

Compression:

Stored size: 1.49 KB

Contents

require File.dirname(__FILE__) + '/../../../spec_helper'

describe 'Fog::AWS::S3::Buckets' do

  describe "#all" do

    it "should return a Fog::AWS::S3::Buckets" do
      s3.buckets.all.should be_a(Fog::AWS::S3::Buckets)
    end

    it "should include persisted buckets" do
      bucket = s3.buckets.create(:name => 'fogbucketname')
      s3.buckets.all.map {|bucket| bucket.name}.should include('fogbucketname')
      bucket.destroy
    end

  end

  describe "#create" do

    before(:each) do
      @bucket = s3.buckets.create(:name => 'fogbucketname')
    end

    after(:each) do
      @bucket.destroy
    end

    it "should return a Fog::AWS::S3::Bucket" do
      @bucket.should be_a(Fog::AWS::S3::Bucket)
    end

    it "should exist on s3" do
      s3.buckets.get(@bucket.name).should_not be_nil
    end

  end

  describe "#get" do

    it "should return a Fog::AWS::S3::Bucket if a matching bucket exists" do
      bucket = s3.buckets.create(:name => 'fogbucketname')
      get = s3.buckets.get('fogbucketname')
      bucket.attributes.should == get.attributes
      bucket.destroy
    end

    it "should return nil if no matching bucket exists" do
      s3.buckets.get('fogbucketname').should be_nil
    end

  end

  describe "#new" do

    it "should return a Fog::AWS::S3::Bucket" do
      s3.buckets.new.should be_a(Fog::AWS::S3::Bucket)
    end

  end

  describe "#reload" do

    it "should return a Fog::AWS::S3::Buckets" do
      s3.buckets.all.should be_a(Fog::AWS::S3::Buckets)
    end

  end

end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
fog-0.0.39 spec/aws/models/s3/buckets_spec.rb
fog-0.0.38 spec/aws/models/s3/buckets_spec.rb
fog-0.0.37 spec/aws/models/s3/buckets_spec.rb
fog-0.0.36 spec/aws/models/s3/buckets_spec.rb
fog-0.0.35 spec/aws/models/s3/buckets_spec.rb
fog-0.0.34 spec/aws/models/s3/buckets_spec.rb
fog-0.0.33 spec/aws/models/s3/buckets_spec.rb
fog-0.0.32 spec/aws/models/s3/buckets_spec.rb
fog-0.0.31 spec/aws/models/s3/buckets_spec.rb
fog-0.0.30 spec/aws/models/s3/buckets_spec.rb
fog-0.0.29 spec/aws/models/s3/buckets_spec.rb
fog-0.0.28 spec/aws/models/s3/buckets_spec.rb
fog-0.0.27 spec/aws/models/s3/buckets_spec.rb
fog-0.0.26 spec/aws/models/s3/buckets_spec.rb
fog-0.0.25 spec/aws/models/s3/buckets_spec.rb
fog-0.0.24 spec/aws/models/s3/buckets_spec.rb
fog-0.0.23 spec/aws/models/s3/buckets_spec.rb
fog-0.0.22 spec/aws/models/s3/buckets_spec.rb
fog-0.0.21 spec/aws/models/s3/buckets_spec.rb
fog-0.0.20 spec/aws/models/s3/buckets_spec.rb