class Gem::TestCase

def quick_gem(name, version='2')

def quick_gem(name, version='2')
  require 'rubygems/specification'
  spec = Gem::Specification.new do |s|
    s.platform    = Gem::Platform::RUBY
    s.name        = name
    s.version     = version
    s.author      = 'A User'
    s.email       = 'example@example.com'
    s.homepage    = 'http://example.com'
    s.summary     = "this is a summary"
    s.description = "This is a test description"
    yield(s) if block_given?
  end
  Gem::Specification.map # HACK: force specs to (re-)load before we write
  written_path = write_file spec.spec_file do |io|
    io.write spec.to_ruby_for_cache
  end
  spec.loaded_from = spec.loaded_from = written_path
  Gem::Specification.reset
  return spec
end