Sha256: 16658607a657a08e21dae682790d16333b6ab112d7509a63b3c28a69d571c764

Contents?: true

Size: 1.32 KB

Versions: 27

Compression:

Stored size: 1.32 KB

Contents

require 'test_helper'

class DeprecatedWhoisTest < Test::Unit::TestCase
  include Whois

  def test_happiness
    assert true
  end


  need_connectivity do

    def test_with_ipv4
      w  = Whois.new('72.17.207.99')

      response = w.search_whois

      assert_equal(response, w.all)
      assert_equal(IPAddr.new('72.17.207.99'), w.ip)
      assert_instance_of(Server::Arin, w.server)
      assert_nil w.host
    end

    def test_with_ipv4_as_ipaddr
      ip = IPAddr.new '72.17.207.99'
      w  = Whois.new(ip)

      response = w.search_whois

      assert_equal(response, w.all)
      assert_equal(IPAddr.new('72.17.207.99'), w.ip)
      assert_instance_of(Server::Arin, w.server)
      assert_nil w.host
    end

    def test_with_ipv6
      w  = Whois.new('2001:db8::1428:57ab')

      response = w.search_whois

      assert_equal(response, w.all)
      assert_equal(IPAddr.new('2001:db8::1428:57ab'), w.ip)
      assert_instance_of(Server::Apnic, w.server)
      assert_nil w.host
    end

    def test_with_ipv6_as_ipaddr
      ip = IPAddr.new '2001:db8::1428:57ab'
      w  = Whois.new(ip)

      response = w.search_whois

      assert_equal(response, w.all)
      assert_equal(IPAddr.new('2001:db8::1428:57ab'), w.ip)
      assert_instance_of(Server::Apnic, w.server)
      assert_nil w.host
    end
  
  end # need connectivity
  
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
whois-1.1.8 test/deprecated_test.rb
whois-1.1.7 test/deprecated_test.rb
whois-1.1.6 test/deprecated_test.rb
whois-1.1.5 test/deprecated_test.rb
whois-1.1.4 test/deprecated_test.rb
whois-1.1.3 test/deprecated_test.rb
whois-1.1.2 test/deprecated_test.rb
whois-1.1.1 test/deprecated_test.rb
whois-1.1.0 test/deprecated_test.rb
whois-1.0.12 test/deprecated_test.rb
whois-1.0.11 test/deprecated_test.rb
whois-1.0.10 test/deprecated_test.rb
whois-1.0.9 test/deprecated_test.rb
whois-1.0.8 test/deprecated_test.rb
whois-1.0.7 test/deprecated_test.rb
whois-1.0.6 test/deprecated_test.rb
whois-1.0.5 test/deprecated_test.rb
whois-1.0.4 test/deprecated_test.rb
whois-1.0.3 test/deprecated_test.rb
whois-1.0.2 test/deprecated_test.rb