Skip to content

Commit 64bfaba

Browse files
committed
Add spec for File::SHARE_DELETE
* See #175
1 parent 19965c7 commit 64bfaba

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

core/file/shared/unlink.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,17 @@
4747
it "accepts an object that has a #to_path method" do
4848
File.send(@method, mock_to_path(@file1)).should == 1
4949
end
50+
51+
ruby_version_is "2.3" do
52+
platform_is :windows do
53+
it "allows deleting an open file with File::SHARE_DELETE" do
54+
path = tmp("share_delete.txt")
55+
File.open(path, mode: File::CREAT | File::WRONLY | File::BINARY | File::SHARE_DELETE) do |f|
56+
File.exist?(path).should be_true
57+
File.send(@method, path)
58+
File.exist?(path).should be_false
59+
end
60+
end
61+
end
62+
end
5063
end

0 commit comments

Comments
 (0)