From 2329a1a88dbbb5b1c9323d485cc95e30f7acbdf8 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 11 Apr 2014 05:40:52 +0000 Subject: 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 --- test/ruby/test_super.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'test/ruby') 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 -- cgit v1.2.3