2011-01-03 14:23:51 -05:00
|
|
|
for provider, config in storage_providers
|
2010-12-29 21:12:51 -05:00
|
|
|
|
2011-06-15 17:26:43 -04:00
|
|
|
Shindo.tests("Storage[:#{provider}] | files", [provider]) do
|
2010-12-29 21:12:51 -05:00
|
|
|
|
2011-01-03 14:23:51 -05:00
|
|
|
if !Fog.mocking? || config[:mocked]
|
2010-12-29 21:12:51 -05:00
|
|
|
|
2011-05-24 20:32:27 -04:00
|
|
|
file_attributes = {
|
|
|
|
:key => 'fog_files_tests',
|
|
|
|
:body => lorem_file
|
|
|
|
}.merge!(config[:file_attributes] || {})
|
|
|
|
|
2011-01-03 18:38:20 -05:00
|
|
|
directory_attributes = {
|
|
|
|
:key => 'fogfilestests'
|
|
|
|
}.merge!(config[:directory_attributes] || {})
|
2010-12-29 21:12:51 -05:00
|
|
|
|
2011-06-15 17:26:43 -04:00
|
|
|
@directory = Fog::Storage[provider].directories.create(directory_attributes)
|
2011-01-03 18:38:20 -05:00
|
|
|
|
|
|
|
collection_tests(@directory.files, file_attributes, config[:mocked])
|
2011-01-03 14:23:51 -05:00
|
|
|
|
|
|
|
@directory.destroy
|
|
|
|
|
|
|
|
end
|
2010-12-29 21:12:51 -05:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|