summaryrefslogtreecommitdiff
path: root/test/stringio/test_stringio.rb
blob: 10390fc6dab433a0eae49261f2f8a9e4538fc761 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require 'test/unit'
require 'stringio'

class TestStringIO < Test::Unit::TestCase
  def test_empty_file
    f = StringIO.new("")
    assert_equal("", f.read(0))
    assert_equal("", f.read)
    assert_equal(nil, f.read(0))
    f = StringIO.new("")
    assert_equal(nil, f.read(1))
    assert_equal(nil, f.read)
    assert_equal(nil, f.read(1))
  end
end