diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-11 05:40:52 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-11 05:40:52 +0000 |
commit | 2329a1a88dbbb5b1c9323d485cc95e30f7acbdf8 (patch) | |
tree | ff62ff3426770c35f602b3253a3b357abaa68a89 /test | |
parent | c7ad29f58ff8b740476fe4f902d9a033e4f521c9 (diff) | |
download | ruby-2329a1a88dbbb5b1c9323d485cc95e30f7acbdf8.tar.gz |
vm_insnhelper.c: preserve encodings
* vm_insnhelper.c (vm_search_super_method): preserve encodings of
classes in message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_super.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb index 9425cc83eb..fcf5773501 100644 --- a/test/ruby/test_super.rb +++ b/test/ruby/test_super.rb @@ -271,12 +271,12 @@ class TestSuper < Test::Unit::TestCase end def test_super_in_instance_eval - super_class = Class.new { + super_class = EnvUtil.labeled_class("Super\u{30af 30e9 30b9}") { def foo return [:super, self] end } - sub_class = Class.new(super_class) { + sub_class = EnvUtil.labeled_class("Sub\u{30af 30e9 30b9}", super_class) { def foo x = Object.new x.instance_eval do @@ -285,18 +285,18 @@ class TestSuper < Test::Unit::TestCase end } obj = sub_class.new - assert_raise(TypeError) do + assert_raise_with_message(TypeError, /Sub\u{30af 30e9 30b9}/) do obj.foo end end def test_super_in_instance_eval_with_define_method - super_class = Class.new { + super_class = EnvUtil.labeled_class("Super\u{30af 30e9 30b9}") { def foo return [:super, self] end } - sub_class = Class.new(super_class) { + sub_class = EnvUtil.labeled_class("Sub\u{30af 30e9 30b9}", super_class) { define_method(:foo) do x = Object.new x.instance_eval do @@ -305,18 +305,18 @@ class TestSuper < Test::Unit::TestCase end } obj = sub_class.new - assert_raise(TypeError) do + assert_raise_with_message(TypeError, /Sub\u{30af 30e9 30b9}/) do obj.foo end end def test_super_in_orphan_block - super_class = Class.new { + super_class = EnvUtil.labeled_class("Super\u{30af 30e9 30b9}") { def foo return [:super, self] end } - sub_class = Class.new(super_class) { + sub_class = EnvUtil.labeled_class("Sub\u{30af 30e9 30b9}", super_class) { def foo lambda { super() } end @@ -326,12 +326,12 @@ class TestSuper < Test::Unit::TestCase end def test_super_in_orphan_block_with_instance_eval - super_class = Class.new { + super_class = EnvUtil.labeled_class("Super\u{30af 30e9 30b9}") { def foo return [:super, self] end } - sub_class = Class.new(super_class) { + sub_class = EnvUtil.labeled_class("Sub\u{30af 30e9 30b9}", super_class) { def foo x = Object.new x.instance_eval do @@ -340,7 +340,7 @@ class TestSuper < Test::Unit::TestCase end } obj = sub_class.new - assert_raise(TypeError) do + assert_raise_with_message(TypeError, /Sub\u{30af 30e9 30b9}/) do obj.foo.call end end |