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

[storage] more helpful naming of attributes in tests

This commit is contained in:
geemus 2011-01-03 15:38:20 -08:00
parent 15832b0eb7
commit 969300ed01
4 changed files with 21 additions and 13 deletions

View file

@ -2,11 +2,11 @@ for provider, config in storage_providers
Shindo.tests("#{provider}::Storage | directories", [provider.to_s.downcase]) do Shindo.tests("#{provider}::Storage | directories", [provider.to_s.downcase]) do
attributes = { directory_attributes = {
:key => 'fogdirectoriestests', :key => 'fogdirectoriestests',
}.merge!(config[:directories_attributes] || {}) }.merge!(config[:directory_attributes] || {})
collection_tests(provider[:storage].directories, attributes, config[:mocked]) collection_tests(provider[:storage].directories, directory_attributes, config[:mocked])
end end

View file

@ -2,11 +2,11 @@ for provider, config in storage_providers
Shindo.tests("#{provider}::Storage | directory", [provider.to_s.downcase]) do Shindo.tests("#{provider}::Storage | directory", [provider.to_s.downcase]) do
attributes = { directory_attributes = {
:key => 'fogdirectorytests' :key => 'fogdirectorytests'
}.merge!(config[:directory_attributes] || {}) }.merge!(config[:directory_attributes] || {})
model_tests(provider[:storage].directory, attributes, config[:mocked]) do model_tests(provider[:storage].directory, directory_attributes, config[:mocked]) do
tests("#public=(true)").succeeds do tests("#public=(true)").succeeds do
pending if Fog.mocking? && !config[:mocked] pending if Fog.mocking? && !config[:mocked]

View file

@ -2,17 +2,21 @@ for provider, config in storage_providers
Shindo.tests("#{provider}::Storage | file", [provider.to_s.downcase]) do Shindo.tests("#{provider}::Storage | file", [provider.to_s.downcase]) do
attributes = { file_attributes = {
:key => 'fog_file_tests', :key => 'fog_file_tests',
:body => lorem_file, :body => lorem_file,
:public => true :public => true
}.merge!(config[:directory_attributes] || {}) }.merge!(config[:file_attributes] || {})
if !Fog.mocking? || config[:mocked] if !Fog.mocking? || config[:mocked]
@directory = provider[:storage].directories.create(:key => 'fogfilestests') directory_attributes = {
:key => 'fogfilestests'
}.merge!(config[:directory_attributes] || {})
model_tests(@directory.files, attributes, config[:mocked]) do @directory = provider[:storage].directories.create(directory_attributes)
model_tests(@directory.files, file_attributes, config[:mocked]) do
responds_to(:public_url) responds_to(:public_url)

View file

@ -2,16 +2,20 @@ for provider, config in storage_providers
Shindo.tests("#{provider}::Storage | files", [provider.to_s.downcase]) do Shindo.tests("#{provider}::Storage | files", [provider.to_s.downcase]) do
attributes = { file_attributes = {
:key => 'fog_files_tests', :key => 'fog_files_tests',
:body => lorem_file :body => lorem_file
}.merge!(config[:files_attributes] || {}) }.merge!(config[:file_attributes] || {})
if !Fog.mocking? || config[:mocked] if !Fog.mocking? || config[:mocked]
@directory = provider.directories.create(:key => 'fogfilestests') directory_attributes = {
:key => 'fogfilestests'
}.merge!(config[:directory_attributes] || {})
collection_tests(@directory.files, attributes, config[:mocked]) @directory = provider.directories.create(directory_attributes)
collection_tests(@directory.files, file_attributes, config[:mocked])
@directory.destroy @directory.destroy