public void ConstantCaching_Qualified_IsDefined2() {
TestOutput(@"
def foo
$M
end
module M
$M = self
A = 1
end
i = 0
while i < 3
puts defined?(foo::A) # tested cache
puts foo::A rescue p $! # tested cache
$M.send(:remove_const, :A) if i == 1
i += 1
end
", @"
constant
1
constant
1
nil
#<NameError: uninitialized constant M::A>
");
}