Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 26 lines (20 sloc) 0.682 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
require 'rubygems'
require 'test/unit'
require 'shoulda'
require 'fakeweb'
require 'mocha'
require 'helpers/output'
require 'pathname'

dir = Pathname(__FILE__).join('..', '..', 'lib')

require dir.join('gemwhois').expand_path
require dir.join('rubygems', 'commands', 'whois_command').expand_path

FakeWeb.allow_net_connect = false

class Test::Unit::TestCase
  include Helpers::Output

  def stub_gem(gem_name, options={})
    FakeWeb.register_uri(:get, "https://rubygems.org/api/v1/gems/#{gem_name}.json", options.merge(:body => fixture_file(gem_name)))
  end

  def fixture_file(gem_name)
    File.read(File.join(File.dirname(__FILE__), 'fixtures', "#{gem_name}.json"))
  end
end
Something went wrong with that request. Please try again.