2013-01-18 15:08:27 -05:00
|
|
|
Shindo.tests("Fog::Storage[:hp] | files", ['hp', 'storage']) do
|
2012-10-02 01:16:26 -04:00
|
|
|
|
|
|
|
file_attributes = {
|
|
|
|
:key => 'fog_files_tests',
|
|
|
|
:body => lorem_file
|
|
|
|
}
|
|
|
|
|
|
|
|
directory_attributes = {
|
|
|
|
:key => 'fogfilestests'
|
|
|
|
}
|
|
|
|
|
2013-01-18 15:08:27 -05:00
|
|
|
collection_tests(Fog::Storage[:hp].directories.create(directory_attributes).files, file_attributes, true)
|
2012-10-02 01:16:26 -04:00
|
|
|
|
2013-01-18 15:08:27 -05:00
|
|
|
@directory = Fog::Storage[:hp].directories.create(directory_attributes)
|
|
|
|
@file = @directory.files.create(file_attributes)
|
2012-10-02 01:16:26 -04:00
|
|
|
|
2013-01-18 15:08:27 -05:00
|
|
|
tests('success') do
|
2012-10-02 01:16:26 -04:00
|
|
|
|
2013-01-18 15:08:27 -05:00
|
|
|
tests("#get_url('#{@directory.key}')").succeeds do
|
|
|
|
@directory.files.get_url(@directory.key)
|
|
|
|
end
|
2012-10-02 01:16:26 -04:00
|
|
|
|
2013-01-18 15:08:27 -05:00
|
|
|
tests("#get_cdn_url('#{@directory.key}')").succeeds do
|
|
|
|
pending if Fog.mocking?
|
|
|
|
@directory.files.get_cdn_url(@directory.key)
|
|
|
|
end
|
2012-10-02 01:16:26 -04:00
|
|
|
|
2013-01-18 15:08:27 -05:00
|
|
|
tests("#get_cdn_ssl_url('#{@directory.key}')").succeeds do
|
|
|
|
pending if Fog.mocking?
|
|
|
|
@directory.files.get_cdn_ssl_url(@directory.key)
|
2012-10-02 01:16:26 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2013-01-18 15:08:27 -05:00
|
|
|
@file.destroy
|
2012-10-02 01:16:26 -04:00
|
|
|
@directory.destroy
|
|
|
|
|
|
|
|
end
|