test/test_buffer_io.rb in tracksperanto-2.2.4 vs test/test_buffer_io.rb in tracksperanto-2.3.0
- old
+ new
@@ -17,6 +17,17 @@
f.rewind
assert_equal 6_000_001, f.read.length
flexmock(f).should_receive(:close!).once
io.close!
end
+
+ def test_to_file_forces_immediate_promotion_to_file
+ io = Tracksperanto::BufferIO.new
+ io.write("a" * 3000)
+ assert_equal 3000, io.pos
+ assert !io.file_backed?
+
+ f = io.to_file
+ assert_equal 3000, f.pos
+ assert f.file_backed?
+ end
end
\ No newline at end of file