2011-01-03 14:23:51 -05:00
|
|
|
for provider, config in storage_providers
|
2010-11-16 18:31:34 -05:00
|
|
|
|
2011-01-03 14:23:51 -05:00
|
|
|
Shindo.tests("#{provider}::Storage | file", [provider.to_s.downcase]) do
|
2010-11-03 21:17:20 -04:00
|
|
|
|
2011-01-03 18:38:20 -05:00
|
|
|
file_attributes = {
|
2011-01-03 14:23:51 -05:00
|
|
|
:key => 'fog_file_tests',
|
|
|
|
:body => lorem_file,
|
|
|
|
:public => true
|
2011-01-03 18:38:20 -05:00
|
|
|
}.merge!(config[:file_attributes] || {})
|
2010-11-03 21:17:20 -04:00
|
|
|
|
2011-01-03 14:23:51 -05:00
|
|
|
if !Fog.mocking? || config[:mocked]
|
2010-12-29 21:12:51 -05:00
|
|
|
|
2011-01-03 18:38:20 -05:00
|
|
|
directory_attributes = {
|
|
|
|
:key => 'fogfilestests'
|
|
|
|
}.merge!(config[:directory_attributes] || {})
|
2010-11-03 21:17:20 -04:00
|
|
|
|
2011-01-03 18:38:20 -05:00
|
|
|
@directory = provider[:storage].directories.create(directory_attributes)
|
|
|
|
|
|
|
|
model_tests(@directory.files, file_attributes, config[:mocked]) do
|
2010-11-18 18:54:54 -05:00
|
|
|
|
2011-01-03 14:23:51 -05:00
|
|
|
responds_to(:public_url)
|
|
|
|
|
|
|
|
tests("#public=(true)").succeeds do
|
|
|
|
pending if Fog.mocking? && !config[:mocked]
|
|
|
|
@instance.public=(true)
|
|
|
|
end
|
|
|
|
|
|
|
|
test("@instance.public_url.nil? || Excon.get(@instance.public_url).body == lorem_file.read") do
|
|
|
|
pending if Fog.mocking?
|
|
|
|
@instance.public_url.nil? || Excon.get(@instance.public_url).body == lorem_file.read
|
|
|
|
end
|
2010-11-18 14:18:46 -05:00
|
|
|
|
2010-11-16 18:31:34 -05:00
|
|
|
end
|
2010-11-05 14:37:12 -04:00
|
|
|
|
2011-01-03 14:23:51 -05:00
|
|
|
@directory.destroy
|
2010-11-03 21:17:20 -04:00
|
|
|
|
2011-01-03 14:23:51 -05:00
|
|
|
end
|
2010-12-29 21:12:51 -05:00
|
|
|
|
2010-11-03 21:17:20 -04:00
|
|
|
end
|
|
|
|
|
2010-11-11 14:54:55 -05:00
|
|
|
end
|