Implement File#to_io
This commit is contained in:
parent
254012644a
commit
1e685ed25e
@ -242,7 +242,7 @@ module FakeFS
|
||||
end
|
||||
|
||||
def to_io
|
||||
raise NotImplementedError
|
||||
self
|
||||
end
|
||||
|
||||
def write_nonblock(string)
|
||||
|
@ -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|
|
||||
|
Loading…
Reference in New Issue
Block a user