* 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
This commit is contained in:
nobu 2011-09-01 08:31:24 +00:00
parent d9acd1965d
commit 43284b6bf8
5 changed files with 39 additions and 5 deletions

View file

@ -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')