summaryrefslogtreecommitdiff
path: root/test/ruby/test_io_buffer.rb
diff options
context:
space:
mode:
authorSamuel Williams <[email protected]>2021-12-20 12:17:38 +1300
committerSamuel Williams <[email protected]>2021-12-21 12:25:42 +1300
commitda46b8d8e5d09f896fb1af5dabea12820f02b3d6 (patch)
tree622b55ab5b16d87d88d98cc1fb21a5d14f4e3b26 /test/ruby/test_io_buffer.rb
parentc3d8d26ad744d2a2dada135196e7d694d2966008 (diff)
Default `IO::Buffer#get_string` to use BINARY encoding.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5303
Diffstat (limited to 'test/ruby/test_io_buffer.rb')
-rw-r--r--test/ruby/test_io_buffer.rb5
1 files changed, 4 insertions, 1 deletions
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