module RSpec::Support::RecursiveConstMethods

def recursive_const_defined?(const_name)

def recursive_const_defined?(const_name)
  parts = normalize_const_name(const_name).split('::')
  parts.inject([Object, '']) do |(mod, full_name), name|
    yield(full_name, name) if block_given? && !(Module === mod)
    return false unless const_defined_on?(mod, name)
    [get_const_defined_on(mod, name), [mod.name, name].join('::')]
  end
end