diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-29 07:11:52 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-29 07:11:52 +0000 |
commit | 3895e300743be093c017dbd5569b946a549ce84b (patch) | |
tree | 27da35c9fab876220c7c05848568af9b0649d486 /test/ruby/test_class.rb | |
parent | 480c84e1afbe54d4b63da64d26fab2d39819557a (diff) | |
download | ruby-3895e300743be093c017dbd5569b946a549ce84b.tar.gz |
test/ruby: tweaked heredocs
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_class.rb')
-rw-r--r-- | test/ruby/test_class.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb index 072729d4e5..5250d4b44a 100644 --- a/test/ruby/test_class.rb +++ b/test/ruby/test_class.rb @@ -297,7 +297,8 @@ class TestClass < Test::Unit::TestCase end def test_cannot_reinitialize_class_with_initialize_copy # [ruby-core:50869] - assert_in_out_err([], <<-'end;', ["Object"], []) + assert_in_out_err([], "#{<<~"begin;"}\n#{<<~'end;'}", ["Object"], []) + begin; class Class def initialize_copy(*); super; end end @@ -579,7 +580,8 @@ class TestClass < Test::Unit::TestCase m.module_eval "class #{n}; end" } - assert_separately([], <<-"end;") + assert_separately([], "#{<<~"begin;"}\n#{<<~"end;"}") + begin; Date = (class C\u{1f5ff}; self; end).new assert_raise_with_message(TypeError, /C\u{1f5ff}/) { require 'date' @@ -588,22 +590,24 @@ class TestClass < Test::Unit::TestCase end def test_should_not_expose_singleton_class_without_metaclass - assert_normal_exit %q{ + assert_normal_exit "#{<<~"begin;"}\n#{<<~'end;'}", '[Bug #11740]' + begin; klass = Class.new(Array) # The metaclass of +klass+ should handle #bla since it should inherit methods from meta:meta:Array def (Array.singleton_class).bla; :bla; end hidden = ObjectSpace.each_object(Class).find { |c| klass.is_a? c and c.inspect.include? klass.inspect } raise unless hidden.nil? - }, '[Bug #11740]' + end; - assert_normal_exit %q{ + assert_normal_exit "#{<<~"begin;"}\n#{<<~'end;'}", '[Bug #11740]' + begin; klass = Class.new(Array) klass.singleton_class # The metaclass of +klass+ should handle #bla since it should inherit methods from meta:meta:Array def (Array.singleton_class).bla; :bla; end hidden = ObjectSpace.each_object(Class).find { |c| klass.is_a? c and c.inspect.include? klass.inspect } raise if hidden.nil? - }, '[Bug #11740]' + end; end end |