Skip to content

Commit

Permalink
Update fixture for whois.usp.ac.fj
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Dec 18, 2013
1 parent 48e76f3 commit 89b2059
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
5 changes: 3 additions & 2 deletions lib/whois/record/parser/whois.usp.ac.fj.rb
Expand Up @@ -60,8 +60,9 @@ class WhoisUspAcFj < Base

property_supported :nameservers do
if content_for_scanner =~ /Domain servers:\n\n((.+\n)+)\n/
$1.split("\n").map do |name|
Record::Nameserver.new(:name => name.strip.downcase)
$1.split("\n").map do |line|
name, ipv4 = line.strip.split(/\s+/)
Record::Nameserver.new(name: name.downcase, ipv4: ipv4)
end
end
end
Expand Down
Expand Up @@ -16,13 +16,17 @@

#expires_on
%s %CLASS{time}
%s %TIME{2011-04-28}
%s %TIME{2014-04-28}


#nameservers
%s %CLASS{array}
%s %SIZE{2}
%s[0] %CLASS{nameserver}
%s[0].name == "ns1.google.com"
%s[0].ipv4 == "216.239.32.10"
%s[0].ipv6 == nil
%s[1] %CLASS{nameserver}
%s[1].name == "ns2.google.com"
%s[1].ipv4 == "216.239.34.10"
%s[1].ipv6 == nil
6 changes: 3 additions & 3 deletions spec/fixtures/responses/whois.usp.ac.fj/status_registered.txt
Expand Up @@ -13,14 +13,14 @@ these terms at any time. By submitting this query, you agree to abide
by this policy.

Domain name: google.com.fj Status: Active
Expires: 28th April 2011
Expires: 28th April 2014

Registrant:
Google Inc.
2400 E. Bayshore Pkwy

Domain servers:

NS1.GOOGLE.COM
NS2.GOOGLE.COM
NS1.GOOGLE.COM 216.239.32.10
NS2.GOOGLE.COM 216.239.34.10

Expand Up @@ -49,7 +49,7 @@
describe "#expires_on" do
it do
expect(subject.expires_on).to be_a(Time)
expect(subject.expires_on).to eq(Time.parse("2011-04-28"))
expect(subject.expires_on).to eq(Time.parse("2014-04-28"))
end
end
describe "#nameservers" do
Expand All @@ -58,8 +58,12 @@
expect(subject.nameservers).to have(2).items
expect(subject.nameservers[0]).to be_a(Whois::Record::Nameserver)
expect(subject.nameservers[0].name).to eq("ns1.google.com")
expect(subject.nameservers[0].ipv4).to eq("216.239.32.10")
expect(subject.nameservers[0].ipv6).to eq(nil)
expect(subject.nameservers[1]).to be_a(Whois::Record::Nameserver)
expect(subject.nameservers[1].name).to eq("ns2.google.com")
expect(subject.nameservers[1].ipv4).to eq("216.239.34.10")
expect(subject.nameservers[1].ipv6).to eq(nil)
end
end
end

0 comments on commit 89b2059

Please sign in to comment.