test/unit/bio/io/flatfile/test_buffer.rb in bio-1.4.3.0001 vs test/unit/bio/io/flatfile/test_buffer.rb in bio-1.5.0

- old
+ new

@@ -182,10 +182,16 @@ Bio::FlatFile::BufferedInputStream.open_file(TestDataFastaFormat01) do |obj| assert_instance_of(Bio::FlatFile::BufferedInputStream, obj) assert_equal(TestDataFastaFormat01, obj.path) obj2 = obj end - assert_raise(IOError) { obj2.close } + # Since Ruby 2.3.0, calling IO#close to closed IO object is allowed + # without error. + if RUBY_VERSION >= "2.3.0" + assert_nothing_raised { obj2.close } + else + assert_raise(IOError) { obj2.close } + end end end #class TestBufferedInputStreamClassMethod class TestBufferedInputStream < Test::Unit::TestCase def setup