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