Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: linrock/whois
...
head fork: linrock/whois
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
View
1  lib/whois/server/adapters/arin.rb
@@ -26,6 +26,7 @@ class Arin < Base
# @return [void]
#
def request(string)
+ string = "n + #{string}"
response = query_the_socket(string, host)
buffer_append response, host
View
16 spec/whois/server/adapters/arin_spec.rb
@@ -10,7 +10,7 @@
it "returns the WHOIS record" do
response = "Whois Response"
expected = response
- server.query_handler.expects(:call).with("0.0.0.0", "whois.arin.net", 43).returns(response)
+ server.query_handler.expects(:call).with("n + 0.0.0.0", "whois.arin.net", 43).returns(response)
record = server.lookup("0.0.0.0")
record.to_s.should == expected
record.parts.should have(1).part
@@ -23,8 +23,8 @@
referral = File.read(fixture("referrals/arin_referral_whois.txt"))
response = "Whois Response"
expected = referral + "\n" + response
- server.query_handler.expects(:call).with("0.0.0.0", "whois.arin.net", 43).returns(referral)
- server.query_handler.expects(:call).with("0.0.0.0", "whois.ripe.net", 43).returns(response)
+ server.query_handler.expects(:call).with("n + 0.0.0.0", "whois.arin.net", 43).returns(referral)
+ server.query_handler.expects(:call).with("n + 0.0.0.0", "whois.ripe.net", 43).returns(response)
record = server.lookup("0.0.0.0")
record.to_s.should == expected
@@ -37,8 +37,8 @@
referral = File.read(fixture("referrals/arin_referral_rwhois.txt"))
response = "Whois Response"
expected = referral + "\n" + response
- server.query_handler.expects(:call).with("0.0.0.0", "whois.arin.net", 43).returns(referral)
- server.query_handler.expects(:call).with("0.0.0.0", "rwhois.servernap.net", 4321).returns(response)
+ server.query_handler.expects(:call).with("n + 0.0.0.0", "whois.arin.net", 43).returns(referral)
+ server.query_handler.expects(:call).with("n + 0.0.0.0", "rwhois.servernap.net", 4321).returns(response)
record = server.lookup("0.0.0.0")
record.to_s.should == expected
@@ -50,8 +50,8 @@
it "ignores referral if options[:referral] is false" do
referral = File.read(fixture("referrals/arin_referral_whois.txt"))
server.options[:referral] = false
- server.query_handler.expects(:call).with("0.0.0.0", "whois.arin.net", 43).returns(referral)
- server.query_handler.expects(:call).with("0.0.0.0", "whois.ripe.net", 43).never
+ server.query_handler.expects(:call).with("n + 0.0.0.0", "whois.arin.net", 43).returns(referral)
+ server.query_handler.expects(:call).with("n + 0.0.0.0", "whois.ripe.net", 43).never
record = server.lookup("0.0.0.0")
record.parts.should have(1).part
@@ -59,7 +59,7 @@
it "ignores referral (gracefully) if missing" do
referral = File.read(fixture("referrals/arin_referral_missing.txt"))
- server.query_handler.expects(:call).with("0.0.0.0", "whois.arin.net", 43).returns(referral)
+ server.query_handler.expects(:call).with("n + 0.0.0.0", "whois.arin.net", 43).returns(referral)
server.query_handler.expects(:call).never
record = server.lookup("0.0.0.0")

No commit comments for this range

Something went wrong with that request. Please try again.