Sha256: 7e49af894ca77f585c8a7c8c28a99693a56049b5c281e73da3b1bb5ebc9ab644
Contents?: true
Size: 1.93 KB
Versions: 102
Compression:
Stored size: 1.93 KB
Contents
require File.dirname(__FILE__) + '/../../../spec_helper' describe 'S3.copy_object' do describe 'success' do before(:each) do AWS[:s3].put_bucket('fogcopyobjectsource') AWS[:s3].put_object('fogcopyobjectsource', 'fog_copy_object_source', lorem_file) AWS[:s3].put_bucket('fogcopyobjectdestination') end after(:each) do AWS[:s3].delete_object('fogcopyobjectdestination', 'fog_copy_object_destination') AWS[:s3].delete_bucket('fogcopyobjectdestination') AWS[:s3].delete_object('fogcopyobjectsource', 'fog_copy_object_source') AWS[:s3].delete_bucket('fogcopyobjectsource') end it 'should return proper attributes' do actual = AWS[:s3].copy_object( 'fogcopyobjectsource', 'fog_copy_object_source', 'fogcopyobjectdestination', 'fog_copy_object_destination' ) actual.status.should == 200 actual.body['ETag'].should be_a(String) actual.body['LastModified'].should be_a(Time) end end describe 'failure' do it 'should raise a NotFound error if the source_bucket does not exist' do lambda { AWS[:s3].copy_object( 'fognotabucket', 'fog_copy_object_source', 'fogcopyobjectdestination', 'fog_copy_object_destination' ) }.should raise_error(Excon::Errors::NotFound) end it 'should raise a NotFound error if the source_object does not exist' do lambda { AWS[:s3].copy_object( 'fogcopyobjectsource', 'fog_not_an_object', 'fogcopyobjectdestination', 'fog_copy_object_destination' ) }.should raise_error(Excon::Errors::NotFound) end it 'should raise a NotFound error if the target_bucket does not exist' do lambda { AWS[:s3].copy_object( 'fogcopyobjectsource', 'fog_copy_object_source', 'fognotabucket', 'fog_copy_object_destination' ) }.should raise_error(Excon::Errors::NotFound) end end end
Version data entries
102 entries across 102 versions & 2 rubygems