Fix FakeFS#close
This commit is contained in:
parent
dd8ff05eec
commit
d2264eb646
@ -217,10 +217,6 @@ module FakeFS
|
||||
super(@file.content, mode)
|
||||
end
|
||||
|
||||
def close
|
||||
@open = false
|
||||
end
|
||||
|
||||
def exists?
|
||||
true
|
||||
end
|
||||
|
@ -330,6 +330,16 @@ class FakeFSTest < Test::Unit::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
def test_File_close_disallows_further_writes
|
||||
path = '/path/to/file.txt'
|
||||
file = File.open(path, 'w')
|
||||
file.write 'Yada'
|
||||
file.close
|
||||
assert_raise IOError do
|
||||
file << "foo"
|
||||
end
|
||||
end
|
||||
|
||||
def test_can_read_from_file_objects
|
||||
path = '/path/to/file.txt'
|
||||
File.open(path, 'w') do |f|
|
||||
|
Loading…
Reference in New Issue
Block a user