Skip to content

Commit 9fc461f

Browse files
committed
Ignore existing directory when creating on local storage
1 parent cae2af0 commit 9fc461f

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

lib/fog/local/models/storage/directory.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def public_url
4040
def save
4141
requires :key
4242

43-
Dir.mkdir(path)
43+
FileUtils.mkpath(path)
4444
true
4545
end
4646

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Shindo.tests('Storage[:local] | directory', ["local"]) do
2+
3+
pending if Fog.mocking?
4+
5+
before do
6+
@options = { :local_root => '~/.fog' }
7+
end
8+
9+
tests('save') do
10+
returns(true) do
11+
connection = Fog::Storage::Local.new(@options)
12+
connection.directories.create(:key => 'directory')
13+
connection.directories.create(:key => 'directory')
14+
end
15+
end
16+
end

0 commit comments

Comments
 (0)