ruby-changes:61378
From: Nobuyoshi <ko1@a...>
Date: Tue, 26 May 2020 15:09:26 +0900 (JST)
Subject: [ruby-changes:61378] 7d5da30c9e (master): Test for [Feature #16832]
https://git.ruby-lang.org/ruby.git/commit/?id=7d5da30c9e From 7d5da30c9e9c572f6ef0aaccc1ca0e724966e2ee Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Tue, 26 May 2020 15:09:07 +0900 Subject: Test for [Feature #16832] diff --git a/test/ruby/test_name_error.rb b/test/ruby/test_name_error.rb index ec03046..813a976 100644 --- a/test/ruby/test_name_error.rb +++ b/test/ruby/test_name_error.rb @@ -57,6 +57,19 @@ class TestNameError < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_name_error.rb#L57 assert_equal(:X, e.name) end + def test_info_const_name + mod = Module.new do + def self.name + "ModuleName" + end + + def self.inspect + raise "<unusable info>" + end + end + assert_raise_with_message(NameError, /ModuleName/) {mod::DOES_NOT_EXIST} + end + def test_info_method obj = PrettyObject.new -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/