From da46b8d8e5d09f896fb1af5dabea12820f02b3d6 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 20 Dec 2021 12:17:38 +1300 Subject: Default `IO::Buffer#get_string` to use BINARY encoding. --- test/ruby/test_io_buffer.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/ruby') diff --git a/test/ruby/test_io_buffer.rb b/test/ruby/test_io_buffer.rb index 0a8685d9d5..f2b9ca45e1 100644 --- a/test/ruby/test_io_buffer.rb +++ b/test/ruby/test_io_buffer.rb @@ -71,7 +71,10 @@ class TestIOBuffer < Test::Unit::TestCase def test_file_mapped buffer = File.open(__FILE__) {|file| IO::Buffer.map(file)} - assert_include buffer.get_string, "Hello World" + contents = buffer.get_string + + assert_include contents, "Hello World" + assert_equal Encoding::BINARY, contents.encoding end def test_file_mapped_invalid -- cgit v1.2.3