Clean up a temporary file
This commit is contained in:
parent
11acb7f7bc
commit
fe67998816
@ -3,9 +3,12 @@ require_relative '../../spec_helper'
|
|||||||
describe "IO#path" do
|
describe "IO#path" do
|
||||||
ruby_version_is "3.2" do
|
ruby_version_is "3.2" do
|
||||||
it "returns the path of the file associated with the IO object" do
|
it "returns the path of the file associated with the IO object" do
|
||||||
File.open(tmp("io_path.txt"), "w") do |file|
|
path = tmp("io_path.txt")
|
||||||
|
File.open(path, "w") do |file|
|
||||||
IO.new(file.fileno, path: file.path, autoclose: false).path.should == file.path
|
IO.new(file.fileno, path: file.path, autoclose: false).path.should == file.path
|
||||||
end
|
end
|
||||||
|
ensure
|
||||||
|
File.unlink(path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user