ruby-changes:54540
From: nobu <ko1@a...>
Date: Tue, 8 Jan 2019 19:53:49 +0900 (JST)
Subject: [ruby-changes:54540] nobu:r66755 (trunk): Check by #name [Bug #15497]
nobu 2019-01-08 19:53:43 +0900 (Tue, 08 Jan 2019) New Revision: 66755 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66755 Log: Check by #name [ruby-core:90853] [Bug #15497] Modified files: trunk/test/ruby/test_module.rb Index: test/ruby/test_module.rb =================================================================== --- test/ruby/test_module.rb (revision 66754) +++ test/ruby/test_module.rb (revision 66755) @@ -2061,17 +2061,13 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_module.rb#L2061 $foo \u3042$ ].each do |name| - assert_raise_with_message(NameError, /#{Regexp.quote(quote(name))}/) do + e = assert_raise(NameError) do Module.new { attr_accessor name.to_sym } end + assert_equal(name, e.name.to_s) end end - private def quote(name) - encoding = Encoding.default_internal || Encoding.default_external - (name.encoding == encoding || name.ascii_only?) ? name : name.inspect - end - class AttrTest class << self attr_accessor :cattr -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/