Ignore existing directory when creating on local storage

This commit is contained in:
Thomas Wright 2012-10-06 17:33:39 -05:00
parent cae2af0806
commit 9fc461f0f8
2 changed files with 17 additions and 1 deletions

View File

@ -40,7 +40,7 @@ module Fog
def save
requires :key
Dir.mkdir(path)
FileUtils.mkpath(path)
true
end

View File

@ -0,0 +1,16 @@
Shindo.tests('Storage[:local] | directory', ["local"]) do
pending if Fog.mocking?
before do
@options = { :local_root => '~/.fog' }
end
tests('save') do
returns(true) do
connection = Fog::Storage::Local.new(@options)
connection.directories.create(:key => 'directory')
connection.directories.create(:key => 'directory')
end
end
end