summaryrefslogtreecommitdiff
path: root/spec/ruby/core/io/path_spec.rb
blob: 798adb2163279f9725a0f2101ae25f051f58f40f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
require_relative '../../spec_helper'

describe "IO#path" do
  it "returns the path of the file associated with the IO object" do
    path = tmp("io_path.txt")
    File.open(path, "w") do |file|
      IO.new(file.fileno, path: file.path, autoclose: false).path.should == file.path
    end
  ensure
    File.unlink(path)
  end
end