avoid mkdir() race conditions - close #75
This commit is contained in:
1 parent
ad703a5c84
commit
be058dd18b
2 files changed
+5
-5
No files matched your search
@@ -26,13 +26,13 @@ module Rscons
|
||||
cache = build_from(_cache)
|
||||
expect(File).to receive(:exists?).with("one").and_return(true)
|
||||
expect(File).to receive(:exists?).with("one/two").and_return(false)
|
||||
expect(FileUtils).to receive(:mkdir).with("one/two")
|
||||
expect(FileUtils).to receive(:mkdir_p).with("one/two")
|
||||
expect(File).to receive(:exists?).with("one/two/three").and_return(false)
|
||||
expect(FileUtils).to receive(:mkdir).with("one/two/three")
|
||||
expect(FileUtils).to receive(:mkdir_p).with("one/two/three")
|
||||
expect(File).to receive(:exists?).with("one").and_return(true)
|
||||
expect(File).to receive(:exists?).with("one/two").and_return(true)
|
||||
expect(File).to receive(:exists?).with("one/two/four").and_return(false)
|
||||
expect(FileUtils).to receive(:mkdir).with("one/two/four")
|
||||
expect(FileUtils).to receive(:mkdir_p).with("one/two/four")
|
||||
cache.mkdir_p("one/two/three")
|
||||
cache.mkdir_p("one\\two\\four")
|
||||
expect(cache.directories).to eq ["one/two", "one/two/three", "one/two/four"]
|
||||
@@ -43,7 +43,7 @@ module Rscons
|
||||
cache = build_from(_cache)
|
||||
expect(File).to receive(:exists?).with("/one").and_return(true)
|
||||
expect(File).to receive(:exists?).with("/one/two").and_return(false)
|
||||
expect(FileUtils).to receive(:mkdir).with("/one/two")
|
||||
expect(FileUtils).to receive(:mkdir_p).with("/one/two")
|
||||
cache.mkdir_p("/one/two")
|
||||
expect(cache.directories).to eq ["/one/two"]
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user