summaryrefslogtreecommitdiff
path: root/test/stringio/test_stringio.rb
diff options
context:
space:
mode:
-rw-r--r--test/stringio/test_stringio.rb10
1 files changed, 9 insertions, 1 deletions
@@ -22,10 +22,11 @@ class TestStringIO < Test::Unit::TestCase
assert_kind_of StringIO, StringIO.new
assert_kind_of StringIO, StringIO.new('str')
assert_kind_of StringIO, StringIO.new('str', 'r+')
assert_raise(ArgumentError) { StringIO.new('', 'x') }
assert_raise(ArgumentError) { StringIO.new('', 'rx') }
assert_raise(ArgumentError) { StringIO.new('', 'rbt') }
- assert_raise(TypeError) { StringIO.new(nil) }
o = Object.new
def o.to_str
@@ -40,6 +41,13 @@ class TestStringIO < Test::Unit::TestCase
assert_kind_of StringIO, StringIO.new(o)
end
def test_truncate
io = StringIO.new("")
io.puts "abc"