summaryrefslogtreecommitdiff
path: root/test/ruby/test_io_buffer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_io_buffer.rb')
-rw-r--r--test/ruby/test_io_buffer.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_io_buffer.rb b/test/ruby/test_io_buffer.rb
index 385a133421..76fa1bd774 100644
--- a/test/ruby/test_io_buffer.rb
+++ b/test/ruby/test_io_buffer.rb
@@ -83,6 +83,7 @@ class TestIOBuffer < Test::Unit::TestCase
def test_string_mapped
string = "Hello World"
buffer = IO::Buffer.for(string)
+ refute buffer.immutable?
# Cannot modify string as it's locked by the buffer:
assert_raise RuntimeError do
@@ -99,6 +100,13 @@ class TestIOBuffer < Test::Unit::TestCase
assert_equal "Hello World", string
end
+ def test_string_mapped_frozen
+ string = "Hello World".freeze
+ buffer = IO::Buffer.for(string)
+
+ assert buffer.immutable?
+ end
+
def test_non_string
not_string = Object.new