class Gem::Specification

def self.add_spec spec

def self.add_spec spec
  warn "Gem::Specification.add_spec is deprecated and will be removed in Rubygems 3.0" unless Gem::Deprecate.skip
  # TODO: find all extraneous adds
  # puts
  # p :add_spec => [spec.full_name, caller.reject { |s| s =~ /minitest/ }]
  # TODO: flush the rest of the crap from the tests
  # raise "no dupes #{spec.full_name} in #{all_names.inspect}" if
  #   _all.include? spec
  raise "nil spec!" unless spec # TODO: remove once we're happy with tests
  return if _all.include? spec
  _all << spec
  stubs << spec
  (@@stubs_by_name[spec.name] ||= []) << spec
  sort_by!(@@stubs_by_name[spec.name]) { |s| s.version }
  _resort!(_all)
  _resort!(stubs)
end