From 969300ed01a3b61f4de4835683ee9132e0e28b36 Mon Sep 17 00:00:00 2001 From: geemus Date: Mon, 3 Jan 2011 15:38:20 -0800 Subject: [PATCH] [storage] more helpful naming of attributes in tests --- tests/storage/models/directories_tests.rb | 6 +++--- tests/storage/models/directory_test.rb | 4 ++-- tests/storage/models/file_tests.rb | 12 ++++++++---- tests/storage/models/files_tests.rb | 12 ++++++++---- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/tests/storage/models/directories_tests.rb b/tests/storage/models/directories_tests.rb index c6caaf6fb..019f53314 100644 --- a/tests/storage/models/directories_tests.rb +++ b/tests/storage/models/directories_tests.rb @@ -2,11 +2,11 @@ for provider, config in storage_providers Shindo.tests("#{provider}::Storage | directories", [provider.to_s.downcase]) do - attributes = { + directory_attributes = { :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 diff --git a/tests/storage/models/directory_test.rb b/tests/storage/models/directory_test.rb index fbc055ffc..c895cf738 100644 --- a/tests/storage/models/directory_test.rb +++ b/tests/storage/models/directory_test.rb @@ -2,11 +2,11 @@ for provider, config in storage_providers Shindo.tests("#{provider}::Storage | directory", [provider.to_s.downcase]) do - attributes = { + directory_attributes = { :key => 'fogdirectorytests' }.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 pending if Fog.mocking? && !config[:mocked] diff --git a/tests/storage/models/file_tests.rb b/tests/storage/models/file_tests.rb index de50e7bda..4c9972518 100644 --- a/tests/storage/models/file_tests.rb +++ b/tests/storage/models/file_tests.rb @@ -2,17 +2,21 @@ for provider, config in storage_providers Shindo.tests("#{provider}::Storage | file", [provider.to_s.downcase]) do - attributes = { + file_attributes = { :key => 'fog_file_tests', :body => lorem_file, :public => true - }.merge!(config[:directory_attributes] || {}) + }.merge!(config[:file_attributes] || {}) 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) diff --git a/tests/storage/models/files_tests.rb b/tests/storage/models/files_tests.rb index 1167ceb87..2d69a0c66 100644 --- a/tests/storage/models/files_tests.rb +++ b/tests/storage/models/files_tests.rb @@ -2,16 +2,20 @@ for provider, config in storage_providers Shindo.tests("#{provider}::Storage | files", [provider.to_s.downcase]) do - attributes = { + file_attributes = { :key => 'fog_files_tests', :body => lorem_file - }.merge!(config[:files_attributes] || {}) + }.merge!(config[:file_attributes] || {}) 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