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

42 lines
1.1 KiB
Ruby
Raw Permalink Normal View History

for provider, config in storage_providers
Shindo.tests("Storage[:#{provider}] | file", [provider.to_s]) do
if !Fog.mocking? || config[:mocked]
2010-12-29 21:12:51 -05:00
file_attributes = {
:key => 'fog_file_tests',
:body => lorem_file,
:public => true
}.merge!(config[:file_attributes] || {})
directory_attributes = {
:key => 'fogfilestests'
}.merge!(config[:directory_attributes] || {})
@directory = Fog::Storage[provider].directories.create(directory_attributes)
model_tests(@directory.files, file_attributes, config[:mocked]) do
responds_to(:public_url)
tests("#public=(true)").succeeds do
2012-07-02 09:03:07 -04:00
pending if Fog.mocking? && !config[:mocked] || !Fog::Storage[provider].respond_to?(:public=)
@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
end
@directory.destroy
end
2010-12-29 21:12:51 -05:00
end
end