Skip to content

Commit e2b77c2

Browse files
eregonAndrii Konchyn
authored andcommitted
Avoid extra file copy in IO::Buffer#shared? spec
1 parent e86a379 commit e2b77c2

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

core/io/buffer/shared_spec.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@
1212
end
1313

1414
it "is true for a non-private buffer created with .map" do
15-
path = tmp("read_text.txt")
16-
File.copy_stream(fixture(__dir__, "read_text.txt"), path)
15+
path = fixture(__dir__, "read_text.txt")
1716
file = File.open(path, "r+")
1817
@buffer = IO::Buffer.map(file)
1918
@buffer.shared?.should == true
2019
ensure
2120
@buffer.free
2221
file.close
23-
File.unlink(path)
2422
end
2523

2624
it "is false for an unshared buffer" do

0 commit comments

Comments
 (0)