1 require 'test/minirunit'
5 class_eval("#{name} = c")
20 test_equal(["FOO"], A1.constants)
21 test_equal(["FOO"], B1.constants)
22 test_equal(B1.const_get("FOO"), String)
23 test_equal("foo", B1.new.do)
25 # tests nesting of classes inside modues
35 test_equal(["FOO"], A2::B2.constants)
36 test_equal(A2::B2.const_get("FOO"), String)
37 test_equal("foo", A2::B2.new.do)
39 # confirm class_eval is nested the same as the calling scope
42 test_equal([A3::B3, A3], Module.nesting)
46 test_equal([A3::B3], A3::B3.class_eval("Module.nesting"))
49 test_equal([A3::B3, C3], A3::B3.class_eval("Module.nesting"))
52 # tests lookup of :: scoped classes
70 test_equal("foo", A4.new.foo)