Sha256: 5d10846079b087d374bf11634e289f42b6d2e416561facdabf62e14ec5f2a930
Contents?: true
Size: 1.25 KB
Versions: 21
Compression:
Stored size: 1.25 KB
Contents
require 'test_helper' class ServerAdaptersAfiliasTest < Test::Unit::TestCase def setup @definition = [:tld, ".foo", "whois.foo", {}] @klass = Whois::Server::Adapters::Afilias @server = @klass.new(*@definition) end def test_query response = "No match for DOMAIN.FOO." expected = response @server.expects(:ask_the_socket).with("domain.foo", "whois.afilias-grs.info", 43).returns(response) assert_equal expected, @server.query("domain.foo").to_s assert_equal [Whois::Answer::Part.new(response, "whois.afilias-grs.info")], @server.buffer end def test_query_with_referral referral = File.read(File.dirname(__FILE__) + "/../../testcases/referrals/afilias.bz.txt") response = "Match for DOMAIN.FOO." expected = referral + "\n" + response @server.expects(:ask_the_socket).with("domain.foo", "whois.afilias-grs.info", 43).returns(referral) @server.expects(:ask_the_socket).with("domain.foo", "whois.belizenic.bz", 43).returns(response) assert_equal expected, @server.query("domain.foo").to_s assert_equal [Whois::Answer::Part.new(referral, "whois.afilias-grs.info"), Whois::Answer::Part.new(response, "whois.belizenic.bz")], @server.buffer end end
Version data entries
21 entries across 21 versions & 1 rubygems