2011-01-03 11:23:51 -08:00
|
|
|
for provider, config in storage_providers
|
2010-11-16 15:31:34 -08:00
|
|
|
|
2011-06-15 14:26:43 -07:00
|
|
|
Shindo.tests("Storage[:#{provider}] | file", [provider]) do
|
2010-11-03 18:17:20 -07:00
|
|
|
|
2011-01-03 11:23:51 -08:00
|
|
|
if !Fog.mocking? || config[:mocked]
|
2010-12-29 18:12:51 -08:00
|
|
|
|
2011-05-24 17:32:27 -07:00
|
|
|
file_attributes = {
|
|
|
|
:key => 'fog_file_tests',
|
|
|
|
:body => lorem_file,
|
|
|
|
:public => true
|
|
|
|
}.merge!(config[:file_attributes] || {})
|
|
|
|
|
2011-01-03 15:38:20 -08:00
|
|
|
directory_attributes = {
|
|
|
|
:key => 'fogfilestests'
|
|
|
|
}.merge!(config[:directory_attributes] || {})
|
2010-11-03 18:17:20 -07:00
|
|
|
|
2011-06-15 14:26:43 -07:00
|
|
|
@directory = Fog::Storage[provider].directories.create(directory_attributes)
|
2011-01-03 15:38:20 -08:00
|
|
|
|
|
|
|
model_tests(@directory.files, file_attributes, config[:mocked]) do
|
2010-11-18 15:54:54 -08:00
|
|
|
|
2011-01-03 11:23:51 -08: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 11:18:46 -08:00
|
|
|
|
2010-11-16 15:31:34 -08:00
|
|
|
end
|
2010-11-05 11:37:12 -07:00
|
|
|
|
2011-01-03 11:23:51 -08:00
|
|
|
@directory.destroy
|
2010-11-03 18:17:20 -07:00
|
|
|
|
2011-01-03 11:23:51 -08:00
|
|
|
end
|
2010-12-29 18:12:51 -08:00
|
|
|
|
2010-11-03 18:17:20 -07:00
|
|
|
end
|
|
|
|
|
2010-11-11 13:54:55 -06:00
|
|
|
end
|