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

[aws|storage] Add Fog::Storage::AWS#delete_multiple_objects

This commit is contained in:
Garret Alfert 2012-01-04 14:19:32 +01:00 committed by Timur Alperovich
parent 066539f191
commit f0e8ae0cff

View file

@ -91,14 +91,20 @@ Shindo.tests('AWS::Storage | object requests', ['aws']) do
tests("#delete_object('#{@directory.identity}', 'fog_object')").succeeds do tests("#delete_object('#{@directory.identity}', 'fog_object')").succeeds do
Fog::Storage[:aws].delete_object(@directory.identity, 'fog_object') Fog::Storage[:aws].delete_object(@directory.identity, 'fog_object')
end end
tests("#get_object_http_url('#{@directory.identity}', 'fog_object', expiration timestamp)").returns(true) do tests("#get_object_http_url('#{@directory.identity}', 'fog_object', expiration timestamp)").returns(true) do
object_url = Fog::Storage[:aws].get_object_http_url(@directory.identity, 'fog_object', (Time.now + 60)) object_url = Fog::Storage[:aws].get_object_http_url(@directory.identity, 'fog_object', (Time.now + 60))
(object_url =~ /http:\/\/#{Regexp.quote(@directory.identity)}\.s3\.amazonaws\.com\/fog_object/) != nil (object_url =~ /http:\/\/#{Regexp.quote(@directory.identity)}\.s3\.amazonaws\.com\/fog_object/) != nil
end end
tests("delete_multiple_objects('#{@directory.identity}', ['fog_object', 'fog_other_object'])").formats(@multiple_delete_format) do tests("delete_multiple_objects('#{@directory.identity}', ['fog_object'])").returns({
Fog::Storage[:aws].delete_multiple_objects(@directory.identity, ['fog_object', 'fog_other_object']).body 'DeleteResult' => [
{ 'Deleted' => { 'Key' => 'fog_object' } }
]
}) do
pending if Fog.mocking?
Fog::Storage[:aws].delete_multiple_objects(@directory.identity, ['fog_object'])
Fog::Storage[:aws].delete_multiple_objects(@directory.identity, ['fog_object']).body
end end
end end
@ -142,6 +148,10 @@ Shindo.tests('AWS::Storage | object requests', ['aws']) do
end end
tests("#delete_multiple_objects('fognonbucket', ['fog_non_object'])").raises(Excon::Errors::NotFound) do tests("#delete_multiple_objects('fognonbucket', ['fog_non_object'])").raises(Excon::Errors::NotFound) do
<<<<<<< HEAD
=======
pending if Fog.mocking?
>>>>>>> [aws|storage] Add Fog::Storage::AWS#delete_multiple_objects
Fog::Storage[:aws].delete_multiple_objects('fognonbucket', ['fog_non_object']) Fog::Storage[:aws].delete_multiple_objects('fognonbucket', ['fog_non_object'])
end end