summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-05 12:57:14 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-05 12:57:14 +0900
commitb2fe7484e7e7c7741f33bfb02c2fc91f03763ab4 (patch)
treef2211767b0fd76a3cc957a43a226cd34cee677fc /test/ruby
parent542d69c894f86cd9a395fdd5296981c998e4a6bf (diff)
Test for f1f04caf60e4fc9dc3b12109e0be831f2d692810
Diffstat (limited to 'test/ruby')
-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)