adding File#flush
This commit is contained in:
parent
820c9df1b0
commit
45b0e2828f
@ -129,6 +129,8 @@ module FakeFS
|
||||
@file.content += content
|
||||
end
|
||||
alias_method :print, :write
|
||||
|
||||
def flush; self; end
|
||||
end
|
||||
|
||||
class Dir
|
||||
|
@ -254,4 +254,9 @@ class FakeFSTest < Test::Unit::TestCase
|
||||
File.open('foo','w'){|f| f.write 'bar' }
|
||||
assert_equal 'bar', File.open('foo'){|f| f.read }
|
||||
end
|
||||
|
||||
def test_flush_exists_on_file
|
||||
r = File.open('foo','w'){|f| f.write 'bar'; f.flush }
|
||||
assert_equal 'foo', r.path
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user