From 43284b6bf8324a762808537d5cd2c0774b662a84 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 1 Sep 2011 08:31:24 +0000 Subject: * insns.def (defineclass), vm_insnhelper.c (vm_get_cvar_base): see also inherited constants for classes without superclass and modules. [ruby-core:37698] [Bug #3423] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33157 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_autoload.rb | 4 +++- test/ruby/test_module.rb | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'test/ruby') diff --git a/test/ruby/test_autoload.rb b/test/ruby/test_autoload.rb index a3a4c5df1a..2b37e44c3f 100644 --- a/test/ruby/test_autoload.rb +++ b/test/ruby/test_autoload.rb @@ -140,7 +140,9 @@ p Foo::Bar t = Thread.new { AutoloadTest } sleep 0.1 # override it - eval %q(AutoloadTest = 1) + EnvUtil.suppress_warning { + eval %q(AutoloadTest = 1) + } t.join assert_equal(1, AutoloadTest) ensure diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb index a51681d29b..7ba71852db 100644 --- a/test/ruby/test_module.rb +++ b/test/ruby/test_module.rb @@ -545,6 +545,20 @@ class TestModule < Test::Unit::TestCase INPUT end + def test_const_in_module + bug3423 = '[ruby-core:37698]' + assert_in_out_err([], <<-INPUT, %w[ok], [], bug3423) +module LangModuleSpecInObject + module LangModuleTop + end +end +include LangModuleSpecInObject +module LangModuleTop +end +puts "ok" if LangModuleSpecInObject::LangModuleTop == LangModuleTop +INPUT + end + def test_class_variable_get c = Class.new c.class_eval('@@foo = :foo') -- cgit v1.2.3