1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

more filling out the specs

This commit is contained in:
Wesley Beary 2009-06-29 22:23:14 -07:00
parent 17975f4e96
commit d3c6e44515
7 changed files with 15 additions and 13 deletions

View file

@ -128,6 +128,7 @@ module Fog
when 'LastModified' when 'LastModified'
@response[:last_modified] = Time.parse(@value) @response[:last_modified] = Time.parse(@value)
end end
end
end end

View file

@ -17,13 +17,13 @@ describe 'S3.copy_object' do
end end
it 'should return proper attributes' do it 'should return proper attributes' do
p 'SHOULD CHECK FOR PROPER ATTRIBUTES'
actual = s3.copy_object( actual = s3.copy_object(
'fogcopyobjectsource', 'fog_copy_object_source', 'fogcopyobjectsource', 'fog_copy_object_source',
'fogcopyobjectdestination', 'fog_copy_object_destination' 'fogcopyobjectdestination', 'fog_copy_object_destination'
) )
actual.status.should == 200 actual.status.should == 200
p actual actual.body[:etag].should be_a(String)
actual.body[:last_modified].should be_a(Time)
end end
end end

View file

@ -11,10 +11,8 @@ describe 'S3.delete_bucket' do
end end
it 'should return proper attributes' do it 'should return proper attributes' do
p 'SHOULD CHECK FOR PROPER ATTRIBUTES'
actual = s3.delete_bucket('fogdeletebucket') actual = s3.delete_bucket('fogdeletebucket')
actual.status.should == 204 actual.status.should == 204
p actual
end end
it 'should not include fogdeletebucket in get_service after delete_bucket' do it 'should not include fogdeletebucket in get_service after delete_bucket' do

View file

@ -13,10 +13,8 @@ describe 'S3.delete_object' do
end end
it 'should return proper attributes' do it 'should return proper attributes' do
p 'SHOULD CHECK FOR PROPER ATTRIBUTES'
actual = s3.delete_object('fogdeleteobject', 'fog_delete_object') actual = s3.delete_object('fogdeleteobject', 'fog_delete_object')
actual.status.should == 204 actual.status.should == 204
p actual
end end
end end

View file

@ -14,10 +14,14 @@ describe 'S3.get_object' do
end end
it 'should return proper attributes' do it 'should return proper attributes' do
p 'SHOULD CHECK FOR PROPER ATTRIBUTES'
actual = s3.get_object('foggetobject', 'fog_get_object') actual = s3.get_object('foggetobject', 'fog_get_object')
actual.status.should == 200 actual.status.should == 200
p actual file = File.open(File.dirname(__FILE__) + '/../../lorem.txt', 'r')
data = file.read
actual.body.should == data
actual.headers['Content-Length'].should == data.length.to_s
actual.headers['ETag'].should be_a(String)
actual.headers['Last-Modified'].should be_a(String)
end end
end end

View file

@ -14,10 +14,13 @@ describe 'S3.head_object' do
end end
it 'should return proper attributes' do it 'should return proper attributes' do
p 'SHOULD CHECK FOR PROPER ATTRIBUTES'
actual = s3.head_object('fogheadobject', 'fog_head_object') actual = s3.head_object('fogheadobject', 'fog_head_object')
actual.status.should == 200 actual.status.should == 200
p actual file = File.open(File.dirname(__FILE__) + '/../../lorem.txt', 'r')
data = file.read
actual.headers['Content-Length'].should == data.length.to_s
actual.headers['ETag'].should be_a(String)
actual.headers['Last-Modified'].should be_a(String)
end end
end end

View file

@ -12,11 +12,9 @@ describe 'S3.put_object' do
end end
it 'should return proper attributes' do it 'should return proper attributes' do
p 'SHOULD CHECK FOR PROPER ATTRIBUTES'
file = File.open(File.dirname(__FILE__) + '/../../lorem.txt', 'r') file = File.open(File.dirname(__FILE__) + '/../../lorem.txt', 'r')
actual = s3.put_object('fogputobject', 'fog_put_object', file) actual = s3.put_object('fogputobject', 'fog_put_object', file)
actual.status.should == 200 actual.status.should == 200
p actual
end end
end end