summaryrefslogtreecommitdiff
path: root/test/ruby/test_object.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-19 01:46:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-19 01:46:42 +0000
commit8b9afe6520eddc81c7edb1328f1543e9df7fea2f (patch)
tree05126011f066f29f06dea0c31075414b9d437e41 /test/ruby/test_object.rb
parentd9a597408f0f192ff25ab51e1e6733fe6fefc01b (diff)
error.c: preserve encoding
* error.c (rb_error_frozen_object): preserve encoding of class name in error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_object.rb')
-rw-r--r--test/ruby/test_object.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb
index 8efbf82646..c132079c1f 100644
--- a/test/ruby/test_object.rb
+++ b/test/ruby/test_object.rb
@@ -68,6 +68,17 @@ class TestObject < Test::Unit::TestCase
assert_equal(true, nil.frozen?)
end
+ def test_frozen_error_message
+ name = "C\u{30c6 30b9 30c8}"
+ klass = EnvUtil.labeled_class(name) {
+ attr_accessor :foo
+ }
+ obj = klass.new.freeze
+ assert_raise_with_message(RuntimeError, /#{name}/) {
+ obj.foo = 1
+ }
+ end
+
def test_nil_to_f
assert_equal(0.0, nil.to_f)
end