Sha256: fd110d1340d06ab9bf66f9c04be38df9095af4cf22c8109eeb853e84c8cb93d2
Contents?: true
Size: 831 Bytes
Versions: 2
Compression:
Stored size: 831 Bytes
Contents
require 'test_helper' # File SysSeek test class class FileSysSeek < Minitest::Test def setup FakeFS.activate! FakeFS::FileSystem.clear end def teardown FakeFS.deactivate! end def test_should_seek_to_position File.open('foo', 'w') do |f| f << '0123456789' end File.open('foo', 'r') do |f| f.sysseek(3) assert_equal 3, f.pos f.sysseek(0) assert_equal 0, f.pos end end def test_seek_returns_offset_into_file File.open('foo', 'w') do |f| # 66 chars long str = '0123456789' \ '0123456789' \ '0123456789' \ '0123456789' \ '0123456789' \ '0123456789' \ '012345' f << str end f = File.open('foo') assert_equal 53, f.sysseek(-13, IO::SEEK_END) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
fakefs-0.7.0 | test/fake/file/sysseek_test.rb |
fakefs-0.6.7 | test/fake/file/sysseek_test.rb |