2 assert_equal 'true', %q( class C; end
3 Object.const_defined?(:C) )
4 assert_equal 'Class', %q( class C; end
6 assert_equal 'C', %q( class C; end
8 assert_equal 'C', %q( class C; end
10 assert_equal 'C', %q( class C; end
12 assert_equal 'Class', %q( class C; end
16 assert_equal 'true', %q( class A; end
18 Object.const_defined?(:C) )
19 assert_equal 'Class', %q( class A; end
22 assert_equal 'C', %q( class A; end
25 assert_equal 'C', %q( class A; end
28 assert_equal 'C', %q( class A; end
31 assert_equal 'Class', %q( class A; end
36 assert_equal 'true', %q( module M; end
37 Object.const_defined?(:M) )
38 assert_equal 'Module', %q( module M; end
40 assert_equal 'M', %q( module M; end
42 assert_equal 'C', %q( module M; end
43 class C; include M; end
47 assert_equal 'A::B', %q( class A; end
50 assert_equal 'A::B', %q( class A; end
53 assert_equal 'A::B', %q( class A; end
56 assert_equal 'Class', %q( class A; end
58 A::B.new.class.class )
59 assert_equal 'A::B::C', %q( class A; end
63 assert_equal 'A::B::C', %q( class A; end
67 assert_equal 'Class', %q( class A; end
71 assert_equal 'A::B::C', %q( class A; end
75 assert_equal 'Class', %q( class A; end
78 A::B::C.new.class.class )
79 assert_equal 'A::B2', %q( class A; end
81 class A::B2 < A::B; end
83 assert_equal 'Class', %q( class A; end
85 class A::B2 < A::B; end
89 assert_equal 'true', %q( class C; end; c1 = ::C
90 class C; end; c2 = ::C
92 assert_equal '1', %q( class C; end
94 begin class C < A; end; rescue TypeError; 1 end )
95 assert_equal '1', %q( class C; end
96 begin module C; end; rescue TypeError; 1 end )
97 assert_equal '1', %q( C = 1 # [yarv-dev:782]
98 begin class C; end; rescue TypeError; 1 end )
99 assert_equal '1', %q( C = 1 # [yarv-dev:800]
100 begin module C; end; rescue TypeError; 1 end )
103 assert_equal '1', %q( class A; end; A::C = 1; A::C )
104 assert_equal '1', %q( A = 7; begin A::C = 7; rescue TypeError; 1 end )
105 assert_equal '1', %q( begin 7::C = 7; rescue TypeError; 1 end )
106 assert_equal 'C', %q( class A; class ::C; end end; C )
107 assert_equal 'Class', %q( class A; class ::C; end end; C.class )
108 assert_equal 'OK', %q( class A; ::C = "OK"; end; C )
109 assert_equal 'String', %q( class A; ::C = "OK"; end; C.class )
112 assert_equal 'Class', %q( class C; end; C.dup.class )
113 assert_equal 'Module', %q( module M; end; M.dup.class )
116 assert_equal "ok", %q{
132 }, '[ruby-core:14378]'