Implement File#to_io

This commit is contained in:
Scott Taylor 2009-11-08 01:13:28 -05:00
parent 254012644a
commit 1e685ed25e
2 changed files with 6 additions and 1 deletions

View File

@ -242,7 +242,7 @@ module FakeFS
end
def to_io
raise NotImplementedError
self
end
def write_nonblock(string)

View File

@ -364,6 +364,11 @@ class FakeFSTest < Test::Unit::TestCase
assert File.file?(path)
end
def test_File_io_returns_self
f = File.open("/foo", "w")
assert_equal f, f.to_io
end
def test_knows_symlink_files_are_files
path = '/path/to/file.txt'
File.open(path, 'w') do |f|