test/server/adapters/afilias_test.rb in whois-1.1.4 vs test/server/adapters/afilias_test.rb in whois-1.1.5
- old
+ new
@@ -10,24 +10,28 @@
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
+ answer = @server.query("domain.foo")
+
+ assert_equal response,
+ answer.to_s
assert_equal [Whois::Answer::Part.new(response, "whois.afilias-grs.info")],
- @server.buffer
+ answer.parts
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)
+ answer = @server.query("domain.foo")
+
assert_equal expected,
- @server.query("domain.foo").to_s
+ answer.to_s
assert_equal [Whois::Answer::Part.new(referral, "whois.afilias-grs.info"), Whois::Answer::Part.new(response, "whois.belizenic.bz")],
- @server.buffer
+ answer.parts
end
end
\ No newline at end of file