diff options
Diffstat (limited to 'test/stringio/test_stringio.rb')
-rw-r--r-- | test/stringio/test_stringio.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb new file mode 100644 index 0000000000..10390fc6da --- /dev/null +++ b/test/stringio/test_stringio.rb @@ -0,0 +1,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 |