mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
6395c3b38d
beyond EOF to IO. [ruby-dev:22205] * test/ruby/ut_eof.rb (TestEOF::Seek): test behaviors at reading beyond EOF. * test/ruby/test_file.rb, * test/stringio/test_stringio.rb: include TestEOF::Seek test case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
17 lines
359 B
Ruby
17 lines
359 B
Ruby
require 'test/unit'
|
|
require 'stringio'
|
|
dir = File.expand_path(__FILE__)
|
|
2.times {dir = File.dirname(dir)}
|
|
$:.replace([File.join(dir, "ruby")] | $:)
|
|
require 'ut_eof'
|
|
|
|
class TestStringIO < Test::Unit::TestCase
|
|
include TestEOF
|
|
def open_file(content)
|
|
f = StringIO.new(content)
|
|
yield f
|
|
end
|
|
alias open_file_rw open_file
|
|
|
|
include TestEOF::Seek
|
|
end
|