summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_exception.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index 9a0de5c430..54e39a0f5f 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -880,6 +880,14 @@ end.join
}
end
+ def test_frozen_error_message
+ obj = Object.new.freeze
+ e = assert_raise_with_message(FrozenError, /can't modify frozen #{obj.class}/) {
+ obj.instance_variable_set(:@test, true)
+ }
+ assert_include(e.message, obj.inspect)
+ end
+
def test_name_error_new_default
error = NameError.new
assert_equal("NameError", error.message)