diff --git a/language/defined_spec.rb b/language/defined_spec.rb index 34408c019..ff444879c 100644 --- a/language/defined_spec.rb +++ b/language/defined_spec.rb @@ -900,6 +900,14 @@ defined?(DefinedSpecs::Undefined).should be_nil end + it "returns nil when the constant is not defined and the parent implements const_missing" do + def DefinedSpecs.const_missing(const) + const + end + + defined?(DefinedSpecs::Undefined).should be_nil + end + it "does not call .const_missing if the constant is not defined" do DefinedSpecs.should_not_receive(:const_missing) defined?(DefinedSpecs::UnknownChild).should be_nil