Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

44 lines (35 sloc) 1.028 kb
require 'helper'
class TestGemwhois < Test::Unit::TestCase
context 'Whois for found gem' do
setup do
@gem = 'httparty'
stub_gem(@gem)
@command = Gem::Commands::WhoisCommand.new
@command.handle_options([@gem])
end
should "work" do
output = <<-STR.unindent
gem name: httparty
owners: John Nunemaker, Sandro Turriate
info: Makes http fun! Also, makes consuming restful web services dead easy.
version: 0.5.2
downloads: 40707
STR
assert_output(output) { @command.execute }
end
end
context "Whois for missing gem" do
setup do
@gem = 'missing'
stub_gem(@gem, :status => ["404", "Not Found"])
@command = Gem::Commands::WhoisCommand.new
@command.handle_options([@gem])
end
should "work" do
output = <<-STR.unindent
Gem not found. It will be mine. Oh yes. It will be mine. *sinister laugh*
STR
assert_output(output) { @command.execute }
end
end
end
Jump to Line
Something went wrong with that request. Please try again.