Sha256: e00a3308b2693242468b769138422e7c42e61cf9a5bd588f7d576a6eb10363a4

Contents?: true

Size: 1.29 KB

Versions: 102

Compression:

Stored size: 1.29 KB

Contents

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

describe 'S3.put_object' do
  describe 'success' do

    before(:each) do
      AWS[:s3].put_bucket('fogputobject')
      @response = AWS[:s3].put_object('fogputobject', 'fog_put_object', lorem_file)
    end

    after(:each) do
      AWS[:s3].delete_object('fogputobject', 'fog_put_object')
      AWS[:s3].delete_bucket('fogputobject')
    end

    it 'should return proper attributes' do
      @response.status.should == 200
    end

    it 'should not raise an error if the object already exists' do
      actual = AWS[:s3].put_object('fogputobject', 'fog_put_object', lorem_file)
      actual.status.should == 200
    end

  end
  describe 'failure' do

    it 'should raise a NotFound error if the bucket does not exist' do
      lambda {
        AWS[:s3].put_object('fognotabucket', 'fog_put_object', lorem_file)
      }.should raise_error(Excon::Errors::NotFound)
    end

    it 'should not raise an error if the object already exists' do
      AWS[:s3].put_bucket('fogputobject')
      AWS[:s3].put_object('fogputobject', 'fog_put_object', lorem_file)
      AWS[:s3].put_object('fogputobject', 'fog_put_object', lorem_file)
      AWS[:s3].delete_object('fogputobject', 'fog_put_object')
      AWS[:s3].delete_bucket('fogputobject')
    end

  end
end

Version data entries

102 entries across 102 versions & 2 rubygems

Version Path
fog-0.2.30 spec/aws/requests/s3/put_object_spec.rb
fog-0.2.28 spec/aws/requests/s3/put_object_spec.rb
fog-0.2.27 spec/aws/requests/s3/put_object_spec.rb
fog-0.2.26 spec/aws/requests/s3/put_object_spec.rb
fog-0.2.25 spec/aws/requests/s3/put_object_spec.rb
fog-0.2.24 spec/aws/requests/s3/put_object_spec.rb
tecnh-fog-0.2.23.vpc spec/aws/requests/s3/put_object_spec.rb
fog-0.2.23 spec/aws/requests/s3/put_object_spec.rb
fog-0.2.22 spec/aws/requests/s3/put_object_spec.rb
fog-0.2.21 spec/aws/requests/s3/put_object_spec.rb
fog-0.2.20 spec/aws/requests/s3/put_object_spec.rb
fog-0.2.19 spec/aws/requests/s3/put_object_spec.rb
fog-0.2.18 spec/aws/requests/s3/put_object_spec.rb
fog-0.2.17 spec/aws/requests/s3/put_object_spec.rb
fog-0.2.16 spec/aws/requests/s3/put_object_spec.rb
fog-0.2.15 spec/aws/requests/s3/put_object_spec.rb
fog-0.2.14 spec/aws/requests/s3/put_object_spec.rb
fog-0.2.13 spec/aws/requests/s3/put_object_spec.rb
fog-0.2.12 spec/aws/requests/s3/put_object_spec.rb
fog-0.2.11 spec/aws/requests/s3/put_object_spec.rb