Sha256: c1362e6be3c088d4b80c41d6a5a127c6082c128d3bbc54d4f8f1873ad2291853

Contents?: true

Size: 874 Bytes

Versions: 1

Compression:

Stored size: 874 Bytes

Contents

require 'test_helper'

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

  def setup
    @definition = [:tld, ".foo", "whois.foo", {}]
    @klass = Server::Adapters::Verisign
    @server = @klass.new(*@definition)
  end

  def test_query
    expected = "No match for DOMAIN.FOO."
    @server.expects(:ask_the_socket).with("=domain.foo", "whois.foo", 43).returns(expected)
    assert_equal expected, @server.query("domain.foo")
  end

  def test_query_with_referral
    response = File.read(File.dirname(__FILE__) + "/../testcases/referrals/crsnic.com.txt")
    expected = "Match for DOMAIN.FOO."
    @server.expects(:ask_the_socket).with("=domain.foo", "whois.foo", 43).returns(response)
    @server.expects(:ask_the_socket).with("domain.foo", "whois.tucows.com", 43).returns(expected)
    assert_equal expected, @server.query("domain.foo")
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
whois-0.5.0 test/adapters/verisign_test.rb