From 6054e6d65e1da1362971ee2f7eaa11ea018a0663 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 9 Sep 2016 01:10:01 +0000 Subject: variable.c: fix deprecated constant message * variable.c (rb_const_search): warn with the actual class/module name which defines the deprecated constant. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_module.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index 43bd3f72b6..e9529273eb 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -1420,6 +1420,7 @@ class TestModule < Test::Unit::TestCase c.const_set(:FOO, "foo") c.deprecate_constant(:FOO) assert_warn(/deprecated/) {c::FOO} + assert_warn(/#{c}::FOO is deprecated/) {Class.new(c)::FOO} bug12382 = '[ruby-core:75505] [Bug #12382]' assert_warn(/deprecated/, bug12382) {c.class_eval "FOO"} end -- cgit v1.2.3