whois 2.0.7 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +84 -10
- data/Rakefile +0 -7
- data/lib/core_ext.rb +9 -45
- data/lib/core_ext/array/extract_options.rb +29 -0
- data/lib/core_ext/array/wrap.rb +48 -0
- data/lib/core_ext/class/attribute.rb +115 -0
- data/lib/core_ext/date_time/conversions.rb +15 -0
- data/lib/core_ext/kernel/singleton_class.rb +13 -0
- data/lib/core_ext/module/remove_method.rb +16 -0
- data/lib/whois.rb +0 -4
- data/lib/whois/definitions/tlds.rb +10 -5
- data/lib/whois/record.rb +0 -3
- data/lib/whois/record/parser.rb +3 -3
- data/lib/whois/record/parser/NOTES.txt +15 -8
- data/lib/whois/record/parser/base.rb +12 -35
- data/lib/whois/record/parser/base_afilias.rb +156 -0
- data/lib/whois/record/parser/example.rb +8 -4
- data/lib/whois/record/parser/jobswhois.verisign-grs.com.rb +2 -2
- data/lib/whois/record/parser/scanners/afilias.rb +13 -4
- data/lib/whois/record/parser/{features → scanners}/ast.rb +1 -1
- data/lib/whois/record/parser/scanners/base.rb +9 -0
- data/lib/whois/record/parser/scanners/cnnic.rb +2 -2
- data/lib/whois/record/parser/scanners/{whoisbiz.rb → whois.biz.rb} +2 -8
- data/lib/whois/record/parser/scanners/whois.denic.de.rb +117 -0
- data/lib/whois/record/parser/scanners/whois.nic.hu.rb +187 -0
- data/lib/whois/record/parser/scanners/{whoisit.rb → whois.nic.it.rb} +2 -2
- data/lib/whois/record/parser/scanners/whois.registry.qa.rb +54 -0
- data/lib/whois/record/parser/scanners/whois.tld.ee.rb +41 -0
- data/lib/whois/record/parser/whois.aero.rb +8 -46
- data/lib/whois/record/parser/whois.afilias-grs.info.rb +2 -51
- data/lib/whois/record/parser/whois.afilias.info.rb +2 -126
- data/lib/whois/record/parser/whois.biz.rb +6 -6
- data/lib/whois/record/parser/whois.cnnic.cn.rb +5 -5
- data/lib/whois/record/parser/whois.crsnic.net.rb +2 -2
- data/lib/whois/record/parser/whois.denic.de.rb +8 -105
- data/lib/whois/record/parser/whois.dotmobiregistry.net.rb +2 -51
- data/lib/whois/record/parser/whois.godaddy.com.rb +138 -0
- data/lib/whois/record/parser/whois.iana.org.rb +2 -2
- data/lib/whois/record/parser/whois.markmonitor.com.rb +13 -12
- data/lib/whois/record/parser/whois.meregistry.net.rb +45 -30
- data/lib/whois/record/parser/whois.nic.af.rb +6 -2
- data/lib/whois/record/parser/whois.nic.ag.rb +2 -51
- data/lib/whois/record/parser/whois.nic.asia.rb +47 -38
- data/lib/whois/record/parser/whois.nic.cc.rb +2 -2
- data/lib/whois/record/parser/whois.nic.hu.rb +7 -174
- data/lib/whois/record/parser/whois.nic.it.rb +6 -6
- data/lib/whois/record/parser/whois.nic.name.rb +1 -5
- data/lib/whois/record/parser/whois.nic.travel.rb +4 -12
- data/lib/whois/record/parser/whois.nic.tv.rb +2 -2
- data/lib/whois/record/parser/whois.nic.us.rb +4 -4
- data/lib/whois/record/parser/whois.nic.xxx.rb +5 -112
- data/lib/whois/record/parser/whois.publicinterestregistry.net.rb +8 -168
- data/lib/whois/record/parser/whois.registry.in.rb +2 -60
- data/lib/whois/record/parser/whois.registry.qa.rb +117 -0
- data/lib/whois/record/parser/whois.ripn.net.rb +4 -84
- data/lib/whois/record/parser/whois.sgnic.sg.rb +13 -5
- data/lib/whois/record/parser/whois.tcinet.ru.rb +102 -0
- data/lib/whois/record/parser/whois.tld.ee.rb +5 -26
- data/lib/whois/record/parser/whois.tonic.to.rb +0 -8
- data/lib/whois/server/adapters/base.rb +23 -10
- data/lib/whois/version.rb +2 -2
- data/spec/fixtures/responses/FIND.txt +1 -0
- data/spec/fixtures/responses/whois.aero/status_available.expected +35 -1
- data/spec/fixtures/responses/whois.aero/status_registered.expected +77 -1
- data/spec/fixtures/responses/whois.afilias-grs.info/bz/status_available.expected +34 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/bz/status_registered.expected +39 -2
- data/spec/fixtures/responses/whois.afilias-grs.info/bz/status_registered.txt +2 -82
- data/spec/fixtures/responses/whois.afilias-grs.info/gi/status_available.expected +34 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/gi/status_registered.expected +76 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/hn/status_available.expected +34 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/hn/status_registered.expected +76 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/lc/status_available.expected +34 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/lc/status_registered.expected +76 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/mn/status_available.expected +34 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/mn/status_registered.expected +76 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/sc/status_available.expected +57 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/sc/status_registered.expected +76 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/vc/status_available.expected +34 -0
- data/spec/fixtures/responses/whois.afilias-grs.info/vc/status_registered.expected +76 -0
- data/spec/fixtures/responses/whois.dotmobiregistry.net/status_available.expected +35 -0
- data/spec/fixtures/responses/whois.dotmobiregistry.net/status_available.txt +1 -25
- data/spec/fixtures/responses/whois.dotmobiregistry.net/status_registered.expected +76 -0
- data/spec/fixtures/responses/whois.educause.edu/{properties_updated_on_unknown.expected → property_updated_on_unknown.expected} +0 -0
- data/spec/fixtures/responses/whois.educause.edu/{properties_updated_on_unknown.txt → property_updated_on_unknown.txt} +0 -0
- data/spec/fixtures/responses/whois.godaddy.com/status_registered.expected +87 -0
- data/spec/fixtures/responses/whois.godaddy.com/status_registered.txt +60 -0
- data/spec/fixtures/responses/whois.markmonitor.com/{properties_empty_contacts.expected → property_contacts_are_blank.expected} +0 -0
- data/spec/fixtures/responses/whois.markmonitor.com/{properties_empty_contacts.txt → property_contacts_are_blank.txt} +0 -0
- data/spec/fixtures/responses/whois.meregistry.net/{property_nameservers_is_missing.expected → property_nameservers_is_blank.expected} +0 -0
- data/spec/fixtures/responses/whois.meregistry.net/{property_nameservers_is_missing.txt → property_nameservers_is_blank.txt} +0 -0
- data/spec/fixtures/responses/whois.meregistry.net/status_available.expected +34 -0
- data/spec/fixtures/responses/whois.meregistry.net/status_registered.expected +77 -0
- data/spec/fixtures/responses/whois.meregistry.net/status_registered.txt +1 -1
- data/spec/fixtures/responses/{whois.nic.asia/property_status_client_delete_prohibited.expected → whois.nic.af/property_status_active.expected} +0 -0
- data/spec/fixtures/responses/whois.nic.af/property_status_active.txt +56 -0
- data/spec/fixtures/responses/{whois.nic.asia/property_status_client_transfer_prohibited.expected → whois.nic.af/property_status_delegated.expected} +0 -0
- data/spec/fixtures/responses/whois.nic.af/property_status_delegated.txt +46 -0
- data/spec/fixtures/responses/whois.nic.af/property_status_not_registered.expected +8 -0
- data/spec/fixtures/responses/whois.nic.af/property_status_not_registered.txt +13 -0
- data/spec/fixtures/responses/whois.nic.ag/status_available.expected +34 -0
- data/spec/fixtures/responses/whois.nic.ag/status_registered.expected +76 -0
- data/spec/fixtures/responses/whois.nic.asia/property_status_multiple.expected +8 -0
- data/spec/fixtures/responses/whois.nic.asia/{property_status_client_delete_prohibited.txt → property_status_multiple.txt} +0 -0
- data/spec/fixtures/responses/whois.nic.asia/property_status_single.expected +8 -0
- data/spec/fixtures/responses/whois.nic.asia/{property_status_client_transfer_prohibited.txt → property_status_single.txt} +76 -76
- data/spec/fixtures/responses/whois.nic.asia/status_available.expected +35 -1
- data/spec/fixtures/responses/whois.nic.asia/status_registered.expected +78 -1
- data/spec/fixtures/responses/whois.nic.dz/{status_available.expected → dz/status_available.expected} +0 -0
- data/spec/fixtures/responses/whois.nic.dz/{status_available.txt → dz/status_available.txt} +0 -0
- data/spec/fixtures/responses/whois.nic.dz/{status_registered.expected → dz/status_registered.expected} +0 -0
- data/spec/fixtures/responses/whois.nic.dz/{status_registered.txt → dz/status_registered.txt} +0 -0
- data/spec/fixtures/responses/whois.nic.name/status_available.expected +1 -1
- data/spec/fixtures/responses/whois.nic.name/status_registered.expected +1 -1
- data/spec/fixtures/responses/whois.nic.travel/property_status_multiple.expected +2 -0
- data/spec/fixtures/responses/whois.nic.travel/property_status_multiple.txt +83 -0
- data/spec/fixtures/responses/whois.nic.travel/property_status_single.expected +2 -0
- data/spec/fixtures/responses/whois.nic.travel/property_status_single.txt +75 -0
- data/spec/fixtures/responses/whois.nic.travel/status_available.expected +1 -1
- data/spec/fixtures/responses/whois.nic.travel/status_registered.expected +1 -1
- data/spec/fixtures/responses/whois.nic.xxx/property_updated_on_blank.expected +2 -0
- data/spec/fixtures/responses/whois.nic.xxx/property_updated_on_blank.txt +98 -0
- data/spec/fixtures/responses/whois.nic.xxx/status_registered.expected +45 -46
- data/spec/fixtures/responses/whois.nic.xxx/status_registered.txt +61 -61
- data/spec/fixtures/responses/whois.publicinterestregistry.net/status_available.expected +1 -1
- data/spec/fixtures/responses/whois.publicinterestregistry.net/status_registered.expected +8 -1
- data/spec/fixtures/responses/whois.registry.in/property_status_missing.expected +1 -1
- data/spec/fixtures/responses/whois.registry.in/property_status_multiple.expected +1 -1
- data/spec/fixtures/responses/whois.registry.in/property_status_ok.expected +1 -1
- data/spec/fixtures/responses/whois.registry.in/status_available.expected +31 -1
- data/spec/fixtures/responses/whois.registry.in/status_registered.expected +70 -1
- data/spec/fixtures/responses/whois.registry.qa/qa/status_available.expected +56 -0
- data/spec/fixtures/responses/whois.registry.qa/qa/status_available.txt +1 -0
- data/spec/fixtures/responses/whois.registry.qa/qa/status_registered.expected +91 -0
- data/spec/fixtures/responses/whois.registry.qa/qa/status_registered.txt +23 -0
- data/spec/fixtures/responses/whois.sgnic.sg/property_nameservers_schema_1_with_ip.expected +12 -0
- data/spec/fixtures/responses/whois.sgnic.sg/property_nameservers_schema_1_with_ip.txt +94 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/ru/property_nameservers_with_ip.expected +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/ru/property_nameservers_with_ip.txt +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/ru/status_available.expected +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/ru/status_available.txt +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/ru/status_registered.expected +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/ru/status_registered.txt +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/su/status_available.expected +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/su/status_available.txt +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/su/status_registered.expected +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/su/status_registered.txt +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/xn--p1ai/status_available.expected +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/xn--p1ai/status_available.txt +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/xn--p1ai/status_registered.expected +0 -0
- data/spec/fixtures/responses/{whois.ripn.net → whois.tcinet.ru}/xn--p1ai/status_registered.txt +0 -0
- data/spec/integration_spec.rb +29 -12
- data/spec/support/helpers/spec_helper.rb +0 -10
- data/spec/tlds +1 -1
- data/spec/whois/record/parser/base_spec.rb +23 -51
- data/spec/whois/record/parser/responses/whois.aero/status_available_spec.rb +49 -1
- data/spec/whois/record/parser/responses/whois.aero/status_registered_spec.rb +91 -1
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/bz/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/bz/status_registered_spec.rb +53 -2
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/gi/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/gi/status_registered_spec.rb +90 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/hn/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/hn/status_registered_spec.rb +90 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/lc/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/lc/status_registered_spec.rb +90 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/mn/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/mn/status_registered_spec.rb +90 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/sc/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/sc/status_registered_spec.rb +90 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/vc/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.afilias-grs.info/vc/status_registered_spec.rb +90 -0
- data/spec/whois/record/parser/responses/whois.dotmobiregistry.net/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.dotmobiregistry.net/status_registered_spec.rb +90 -0
- data/spec/whois/record/parser/responses/whois.educause.edu/{properties_updated_on_unknown_spec.rb → property_updated_on_unknown_spec.rb} +3 -3
- data/spec/whois/record/parser/responses/whois.godaddy.com/status_registered_spec.rb +131 -0
- data/spec/whois/record/parser/responses/whois.markmonitor.com/{properties_empty_contacts_spec.rb → property_contacts_are_blank_spec.rb} +3 -3
- data/spec/whois/record/parser/responses/whois.meregistry.net/{property_nameservers_is_missing_spec.rb → property_nameservers_is_blank_spec.rb} +3 -3
- data/spec/whois/record/parser/responses/whois.meregistry.net/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.meregistry.net/status_registered_spec.rb +91 -0
- data/spec/whois/record/parser/responses/whois.nic.af/property_status_active_spec.rb +39 -0
- data/spec/whois/record/parser/responses/whois.nic.af/property_status_delegated_spec.rb +39 -0
- data/spec/whois/record/parser/responses/whois.nic.af/property_status_not_registered_spec.rb +39 -0
- data/spec/whois/record/parser/responses/whois.nic.ag/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.nic.ag/status_registered_spec.rb +90 -0
- data/spec/whois/record/parser/responses/whois.nic.asia/{property_status_client_delete_prohibited_spec.rb → property_status_multiple_spec.rb} +4 -4
- data/spec/whois/record/parser/responses/whois.nic.asia/{property_status_client_transfer_prohibited_spec.rb → property_status_single_spec.rb} +4 -4
- data/spec/whois/record/parser/responses/whois.nic.asia/status_available_spec.rb +49 -1
- data/spec/whois/record/parser/responses/whois.nic.asia/status_registered_spec.rb +92 -1
- data/spec/whois/record/parser/responses/whois.nic.dz/{status_available_spec.rb → dz/status_available_spec.rb} +2 -2
- data/spec/whois/record/parser/responses/whois.nic.dz/{status_registered_spec.rb → dz/status_registered_spec.rb} +2 -2
- data/spec/whois/record/parser/responses/whois.nic.name/status_available_spec.rb +1 -1
- data/spec/whois/record/parser/responses/whois.nic.name/status_registered_spec.rb +1 -1
- data/spec/whois/record/parser/responses/whois.nic.travel/property_status_multiple_spec.rb +29 -0
- data/spec/whois/record/parser/responses/whois.nic.travel/property_status_single_spec.rb +29 -0
- data/spec/whois/record/parser/responses/whois.nic.travel/status_available_spec.rb +1 -1
- data/spec/whois/record/parser/responses/whois.nic.travel/status_registered_spec.rb +1 -1
- data/spec/whois/record/parser/responses/whois.nic.xxx/property_updated_on_blank_spec.rb +29 -0
- data/spec/whois/record/parser/responses/whois.nic.xxx/status_registered_spec.rb +45 -46
- data/spec/whois/record/parser/responses/whois.publicinterestregistry.net/status_available_spec.rb +1 -1
- data/spec/whois/record/parser/responses/whois.publicinterestregistry.net/status_registered_spec.rb +11 -1
- data/spec/whois/record/parser/responses/whois.registry.in/property_status_missing_spec.rb +1 -1
- data/spec/whois/record/parser/responses/whois.registry.in/property_status_multiple_spec.rb +1 -1
- data/spec/whois/record/parser/responses/whois.registry.in/property_status_ok_spec.rb +1 -1
- data/spec/whois/record/parser/responses/whois.registry.in/status_available_spec.rb +44 -1
- data/spec/whois/record/parser/responses/whois.registry.in/status_registered_spec.rb +83 -1
- data/spec/whois/record/parser/responses/whois.registry.qa/qa/status_available_spec.rb +107 -0
- data/spec/whois/record/parser/responses/whois.registry.qa/qa/status_registered_spec.rb +142 -0
- data/spec/whois/record/parser/responses/whois.sgnic.sg/property_nameservers_schema_1_with_ip_spec.rb +39 -0
- data/spec/whois/record/parser/responses/{whois.ripn.net → whois.tcinet.ru}/ru/property_nameservers_with_ip_spec.rb +4 -4
- data/spec/whois/record/parser/responses/{whois.ripn.net/su → whois.tcinet.ru/ru}/status_available_spec.rb +4 -4
- data/spec/whois/record/parser/responses/{whois.ripn.net → whois.tcinet.ru}/ru/status_registered_spec.rb +4 -4
- data/spec/whois/record/parser/responses/{whois.ripn.net/ru → whois.tcinet.ru/su}/status_available_spec.rb +4 -4
- data/spec/whois/record/parser/responses/{whois.ripn.net → whois.tcinet.ru}/su/status_registered_spec.rb +4 -4
- data/spec/whois/record/parser/responses/{whois.ripn.net → whois.tcinet.ru}/xn--p1ai/status_available_spec.rb +4 -4
- data/spec/whois/record/parser/responses/{whois.ripn.net → whois.tcinet.ru}/xn--p1ai/status_registered_spec.rb +4 -4
- data/spec/whois/record_spec.rb +4 -4
- data/spec/whois/server/adapters/afilias_spec.rb +3 -3
- data/spec/whois/server/adapters/base_spec.rb +50 -10
- data/spec/whois/server/adapters/formatted_spec.rb +4 -4
- data/spec/whois/server/adapters/pir_spec.rb +3 -3
- data/spec/whois/server/adapters/standard_spec.rb +4 -4
- data/spec/whois/server/adapters/verisign_spec.rb +7 -7
- data/whois.gemspec +4 -4
- metadata +101 -57
- data/lib/whois/answer.rb +0 -14
data/spec/whois/record/parser/responses/whois.sgnic.sg/property_nameservers_schema_1_with_ip_spec.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
# This file is autogenerated. Do not edit it manually.
|
4
|
+
# If you want change the content of this file, edit
|
5
|
+
#
|
6
|
+
# /spec/fixtures/responses/whois.sgnic.sg/property_nameservers_schema_1_with_ip.expected
|
7
|
+
#
|
8
|
+
# and regenerate the tests with the following rake task
|
9
|
+
#
|
10
|
+
# $ rake genspec:parsers
|
11
|
+
#
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'whois/record/parser/whois.sgnic.sg.rb'
|
15
|
+
|
16
|
+
describe Whois::Record::Parser::WhoisSgnicSg, "property_nameservers_schema_1_with_ip.expected" do
|
17
|
+
|
18
|
+
before(:each) do
|
19
|
+
file = fixture("responses", "whois.sgnic.sg/property_nameservers_schema_1_with_ip.txt")
|
20
|
+
part = Whois::Record::Part.new(:body => File.read(file))
|
21
|
+
@parser = klass.new(part)
|
22
|
+
end
|
23
|
+
|
24
|
+
describe "#nameservers" do
|
25
|
+
it do
|
26
|
+
@parser.nameservers.should be_a(Array)
|
27
|
+
@parser.nameservers.should have(3).items
|
28
|
+
@parser.nameservers[0].should be_a(_nameserver)
|
29
|
+
@parser.nameservers[0].name.should == "dnssec1.singnet.com.sg"
|
30
|
+
@parser.nameservers[0].ipv4.should == "165.21.83.11"
|
31
|
+
@parser.nameservers[1].should be_a(_nameserver)
|
32
|
+
@parser.nameservers[1].name.should == "dnssec2.singnet.com.sg"
|
33
|
+
@parser.nameservers[1].ipv4.should == "195.13.10.226"
|
34
|
+
@parser.nameservers[2].should be_a(_nameserver)
|
35
|
+
@parser.nameservers[2].name.should == "dnssec3.singnet.com.sg"
|
36
|
+
@parser.nameservers[2].ipv4.should == "165.21.100.11"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# This file is autogenerated. Do not edit it manually.
|
4
4
|
# If you want change the content of this file, edit
|
5
5
|
#
|
6
|
-
# /spec/fixtures/responses/whois.
|
6
|
+
# /spec/fixtures/responses/whois.tcinet.ru/ru/property_nameservers_with_ip.expected
|
7
7
|
#
|
8
8
|
# and regenerate the tests with the following rake task
|
9
9
|
#
|
@@ -11,12 +11,12 @@
|
|
11
11
|
#
|
12
12
|
|
13
13
|
require 'spec_helper'
|
14
|
-
require 'whois/record/parser/whois.
|
14
|
+
require 'whois/record/parser/whois.tcinet.ru.rb'
|
15
15
|
|
16
|
-
describe Whois::Record::Parser::
|
16
|
+
describe Whois::Record::Parser::WhoisTcinetRu, "property_nameservers_with_ip.expected" do
|
17
17
|
|
18
18
|
before(:each) do
|
19
|
-
file = fixture("responses", "whois.
|
19
|
+
file = fixture("responses", "whois.tcinet.ru/ru/property_nameservers_with_ip.txt")
|
20
20
|
part = Whois::Record::Part.new(:body => File.read(file))
|
21
21
|
@parser = klass.new(part)
|
22
22
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# This file is autogenerated. Do not edit it manually.
|
4
4
|
# If you want change the content of this file, edit
|
5
5
|
#
|
6
|
-
# /spec/fixtures/responses/whois.
|
6
|
+
# /spec/fixtures/responses/whois.tcinet.ru/ru/status_available.expected
|
7
7
|
#
|
8
8
|
# and regenerate the tests with the following rake task
|
9
9
|
#
|
@@ -11,12 +11,12 @@
|
|
11
11
|
#
|
12
12
|
|
13
13
|
require 'spec_helper'
|
14
|
-
require 'whois/record/parser/whois.
|
14
|
+
require 'whois/record/parser/whois.tcinet.ru.rb'
|
15
15
|
|
16
|
-
describe Whois::Record::Parser::
|
16
|
+
describe Whois::Record::Parser::WhoisTcinetRu, "status_available.expected" do
|
17
17
|
|
18
18
|
before(:each) do
|
19
|
-
file = fixture("responses", "whois.
|
19
|
+
file = fixture("responses", "whois.tcinet.ru/ru/status_available.txt")
|
20
20
|
part = Whois::Record::Part.new(:body => File.read(file))
|
21
21
|
@parser = klass.new(part)
|
22
22
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# This file is autogenerated. Do not edit it manually.
|
4
4
|
# If you want change the content of this file, edit
|
5
5
|
#
|
6
|
-
# /spec/fixtures/responses/whois.
|
6
|
+
# /spec/fixtures/responses/whois.tcinet.ru/ru/status_registered.expected
|
7
7
|
#
|
8
8
|
# and regenerate the tests with the following rake task
|
9
9
|
#
|
@@ -11,12 +11,12 @@
|
|
11
11
|
#
|
12
12
|
|
13
13
|
require 'spec_helper'
|
14
|
-
require 'whois/record/parser/whois.
|
14
|
+
require 'whois/record/parser/whois.tcinet.ru.rb'
|
15
15
|
|
16
|
-
describe Whois::Record::Parser::
|
16
|
+
describe Whois::Record::Parser::WhoisTcinetRu, "status_registered.expected" do
|
17
17
|
|
18
18
|
before(:each) do
|
19
|
-
file = fixture("responses", "whois.
|
19
|
+
file = fixture("responses", "whois.tcinet.ru/ru/status_registered.txt")
|
20
20
|
part = Whois::Record::Part.new(:body => File.read(file))
|
21
21
|
@parser = klass.new(part)
|
22
22
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# This file is autogenerated. Do not edit it manually.
|
4
4
|
# If you want change the content of this file, edit
|
5
5
|
#
|
6
|
-
# /spec/fixtures/responses/whois.
|
6
|
+
# /spec/fixtures/responses/whois.tcinet.ru/su/status_available.expected
|
7
7
|
#
|
8
8
|
# and regenerate the tests with the following rake task
|
9
9
|
#
|
@@ -11,12 +11,12 @@
|
|
11
11
|
#
|
12
12
|
|
13
13
|
require 'spec_helper'
|
14
|
-
require 'whois/record/parser/whois.
|
14
|
+
require 'whois/record/parser/whois.tcinet.ru.rb'
|
15
15
|
|
16
|
-
describe Whois::Record::Parser::
|
16
|
+
describe Whois::Record::Parser::WhoisTcinetRu, "status_available.expected" do
|
17
17
|
|
18
18
|
before(:each) do
|
19
|
-
file = fixture("responses", "whois.
|
19
|
+
file = fixture("responses", "whois.tcinet.ru/su/status_available.txt")
|
20
20
|
part = Whois::Record::Part.new(:body => File.read(file))
|
21
21
|
@parser = klass.new(part)
|
22
22
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# This file is autogenerated. Do not edit it manually.
|
4
4
|
# If you want change the content of this file, edit
|
5
5
|
#
|
6
|
-
# /spec/fixtures/responses/whois.
|
6
|
+
# /spec/fixtures/responses/whois.tcinet.ru/su/status_registered.expected
|
7
7
|
#
|
8
8
|
# and regenerate the tests with the following rake task
|
9
9
|
#
|
@@ -11,12 +11,12 @@
|
|
11
11
|
#
|
12
12
|
|
13
13
|
require 'spec_helper'
|
14
|
-
require 'whois/record/parser/whois.
|
14
|
+
require 'whois/record/parser/whois.tcinet.ru.rb'
|
15
15
|
|
16
|
-
describe Whois::Record::Parser::
|
16
|
+
describe Whois::Record::Parser::WhoisTcinetRu, "status_registered.expected" do
|
17
17
|
|
18
18
|
before(:each) do
|
19
|
-
file = fixture("responses", "whois.
|
19
|
+
file = fixture("responses", "whois.tcinet.ru/su/status_registered.txt")
|
20
20
|
part = Whois::Record::Part.new(:body => File.read(file))
|
21
21
|
@parser = klass.new(part)
|
22
22
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# This file is autogenerated. Do not edit it manually.
|
4
4
|
# If you want change the content of this file, edit
|
5
5
|
#
|
6
|
-
# /spec/fixtures/responses/whois.
|
6
|
+
# /spec/fixtures/responses/whois.tcinet.ru/xn--p1ai/status_available.expected
|
7
7
|
#
|
8
8
|
# and regenerate the tests with the following rake task
|
9
9
|
#
|
@@ -11,12 +11,12 @@
|
|
11
11
|
#
|
12
12
|
|
13
13
|
require 'spec_helper'
|
14
|
-
require 'whois/record/parser/whois.
|
14
|
+
require 'whois/record/parser/whois.tcinet.ru.rb'
|
15
15
|
|
16
|
-
describe Whois::Record::Parser::
|
16
|
+
describe Whois::Record::Parser::WhoisTcinetRu, "status_available.expected" do
|
17
17
|
|
18
18
|
before(:each) do
|
19
|
-
file = fixture("responses", "whois.
|
19
|
+
file = fixture("responses", "whois.tcinet.ru/xn--p1ai/status_available.txt")
|
20
20
|
part = Whois::Record::Part.new(:body => File.read(file))
|
21
21
|
@parser = klass.new(part)
|
22
22
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# This file is autogenerated. Do not edit it manually.
|
4
4
|
# If you want change the content of this file, edit
|
5
5
|
#
|
6
|
-
# /spec/fixtures/responses/whois.
|
6
|
+
# /spec/fixtures/responses/whois.tcinet.ru/xn--p1ai/status_registered.expected
|
7
7
|
#
|
8
8
|
# and regenerate the tests with the following rake task
|
9
9
|
#
|
@@ -11,12 +11,12 @@
|
|
11
11
|
#
|
12
12
|
|
13
13
|
require 'spec_helper'
|
14
|
-
require 'whois/record/parser/whois.
|
14
|
+
require 'whois/record/parser/whois.tcinet.ru.rb'
|
15
15
|
|
16
|
-
describe Whois::Record::Parser::
|
16
|
+
describe Whois::Record::Parser::WhoisTcinetRu, "status_registered.expected" do
|
17
17
|
|
18
18
|
before(:each) do
|
19
|
-
file = fixture("responses", "whois.
|
19
|
+
file = fixture("responses", "whois.tcinet.ru/xn--p1ai/status_registered.txt")
|
20
20
|
part = Whois::Record::Part.new(:body => File.read(file))
|
21
21
|
@parser = klass.new(part)
|
22
22
|
end
|
data/spec/whois/record_spec.rb
CHANGED
@@ -102,14 +102,14 @@ describe Whois::Record do
|
|
102
102
|
(one.eql? two).should be_false
|
103
103
|
end
|
104
104
|
|
105
|
-
it "returns
|
105
|
+
it "returns false when other is string and has the same content" do
|
106
106
|
one, two = klass.new(@server, @parts), klass.new(@server, @parts).to_s
|
107
107
|
|
108
|
-
(one == two).should
|
109
|
-
(one.eql? two).should
|
108
|
+
(one == two).should be_false
|
109
|
+
(one.eql? two).should be_false
|
110
110
|
end
|
111
111
|
|
112
|
-
it "returns false when other is string and has different content"
|
112
|
+
it "returns false when other is string and has different content" do
|
113
113
|
one, two = klass.new(@server, @parts), "different"
|
114
114
|
|
115
115
|
(one == two).should be_false
|
@@ -13,7 +13,7 @@ describe Whois::Server::Adapters::Afilias do
|
|
13
13
|
it "returns the WHOIS record" do
|
14
14
|
response = "No match for DOMAIN.TEST."
|
15
15
|
expected = response
|
16
|
-
@server.expects(:ask_the_socket).with("domain.test", "whois.afilias-grs.info", 43
|
16
|
+
@server.expects(:ask_the_socket).with("domain.test", "whois.afilias-grs.info", 43).returns(response)
|
17
17
|
|
18
18
|
record = @server.query("domain.test")
|
19
19
|
record.to_s.should == expected
|
@@ -27,8 +27,8 @@ describe Whois::Server::Adapters::Afilias do
|
|
27
27
|
referral = File.read(fixture("referrals/afilias.bz.txt"))
|
28
28
|
response = "Match for DOMAIN.TEST."
|
29
29
|
expected = referral + "\n" + response
|
30
|
-
@server.expects(:ask_the_socket).with("domain.test", "whois.afilias-grs.info", 43
|
31
|
-
@server.expects(:ask_the_socket).with("domain.test", "whois.belizenic.bz", 43
|
30
|
+
@server.expects(:ask_the_socket).with("domain.test", "whois.afilias-grs.info", 43).returns(referral)
|
31
|
+
@server.expects(:ask_the_socket).with("domain.test", "whois.belizenic.bz", 43).returns(response)
|
32
32
|
|
33
33
|
record = @server.query("domain.test")
|
34
34
|
record.to_s.should == expected
|
@@ -2,9 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe Whois::Server::Adapters::Base do
|
4
4
|
|
5
|
-
|
6
|
-
@definition = [:tld, ".test", "whois.test", { :foo => "bar" }]
|
7
|
-
end
|
5
|
+
let(:definition) { [:tld, ".test", "whois.test", { :foo => "bar" }] }
|
8
6
|
|
9
7
|
|
10
8
|
describe "#initialize" do
|
@@ -34,14 +32,14 @@ describe Whois::Server::Adapters::Base do
|
|
34
32
|
|
35
33
|
describe "#==" do
|
36
34
|
it "returns true when other is the same instance" do
|
37
|
-
one = two = klass.new(
|
35
|
+
one = two = klass.new(*definition)
|
38
36
|
|
39
37
|
(one == two).should be_true
|
40
38
|
(one.eql? two).should be_true
|
41
39
|
end
|
42
40
|
|
43
41
|
it "returns true when other has same class and has the same attributes" do
|
44
|
-
one, two = klass.new(
|
42
|
+
one, two = klass.new(*definition), klass.new(*definition)
|
45
43
|
|
46
44
|
(one == two).should be_true
|
47
45
|
(one.eql? two).should be_true
|
@@ -49,14 +47,14 @@ describe Whois::Server::Adapters::Base do
|
|
49
47
|
|
50
48
|
it "returns true when other has descendant class and has the same attributes" do
|
51
49
|
subklass = Class.new(klass)
|
52
|
-
one, two = klass.new(
|
50
|
+
one, two = klass.new(*definition), subklass.new(*definition)
|
53
51
|
|
54
52
|
(one == two).should be_true
|
55
53
|
(one.eql? two).should be_true
|
56
54
|
end
|
57
55
|
|
58
56
|
it "returns false when other has different class and has the same attributes" do
|
59
|
-
one, two = klass.new(
|
57
|
+
one, two = klass.new(*definition), Struct.new(:type, :allocation, :host, :options).new(*definition)
|
60
58
|
|
61
59
|
(one == two).should be_false
|
62
60
|
(one.eql? two).should be_false
|
@@ -96,13 +94,13 @@ describe Whois::Server::Adapters::Base do
|
|
96
94
|
|
97
95
|
describe "#query" do
|
98
96
|
it "raises NotImplementedError" do
|
99
|
-
lambda { klass.new(
|
97
|
+
lambda { klass.new(*definition).query("example.test") }.should raise_error(NotImplementedError)
|
100
98
|
end
|
101
99
|
end
|
102
100
|
|
103
101
|
describe "#request" do
|
104
102
|
it "is an abstract method" do
|
105
|
-
lambda { klass.new(
|
103
|
+
lambda { klass.new(*definition).request("example.test") }.should raise_error(NotImplementedError)
|
106
104
|
end
|
107
105
|
end
|
108
106
|
|
@@ -111,10 +109,52 @@ describe Whois::Server::Adapters::Base do
|
|
111
109
|
it "re-raises #{error} as Whois::ConnectionError" do
|
112
110
|
klass.any_instance.expects(:ask_the_socket).raises(error)
|
113
111
|
expect {
|
114
|
-
klass.new(
|
112
|
+
klass.new(*definition).send(:query_the_socket, "example.com", "whois.test")
|
115
113
|
}.to raise_error(Whois::ConnectionError, "#{error}: #{error.new.message}")
|
116
114
|
end
|
117
115
|
end
|
116
|
+
|
117
|
+
context "without :bind_host or :bind_port options" do
|
118
|
+
before(:each) do
|
119
|
+
@base = klass.new(:tld, ".test", "whois.test", {})
|
120
|
+
end
|
121
|
+
|
122
|
+
it "does not bind the WHOIS query" do
|
123
|
+
@base \
|
124
|
+
.expects(:ask_the_socket) \
|
125
|
+
.with("example.test", "whois.test", 43)
|
126
|
+
|
127
|
+
@base.send(:query_the_socket, "example.test", "whois.test", 43)
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
context "with :bind_host and :bind_port options" do
|
132
|
+
before(:each) do
|
133
|
+
@base = klass.new(:tld, ".test", "whois.test", { :bind_host => "192.168.1.1", :bind_port => 3000 })
|
134
|
+
end
|
135
|
+
|
136
|
+
it "binds the WHOIS query to given host and port" do
|
137
|
+
@base \
|
138
|
+
.expects(:ask_the_socket) \
|
139
|
+
.with("example.test", "whois.test", 43, "192.168.1.1", 3000)
|
140
|
+
|
141
|
+
@base.send(:query_the_socket, "example.test", "whois.test", 43)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
context "with :bind_port and without :bind_host options" do
|
146
|
+
before(:each) do
|
147
|
+
@base = klass.new(:tld, ".test", "whois.test", { :bind_port => 3000 })
|
148
|
+
end
|
149
|
+
|
150
|
+
it "binds the WHOIS query to given port and defaults host" do
|
151
|
+
@base \
|
152
|
+
.expects(:ask_the_socket) \
|
153
|
+
.with("example.test", "whois.test", 43, klass::DEFAULT_BIND_HOST, 3000)
|
154
|
+
|
155
|
+
@base.send(:query_the_socket, "example.test", "whois.test", 43)
|
156
|
+
end
|
157
|
+
end
|
118
158
|
end
|
119
159
|
|
120
160
|
end
|
@@ -12,7 +12,7 @@ describe Whois::Server::Adapters::Formatted do
|
|
12
12
|
response = "Whois Response"
|
13
13
|
expected = response
|
14
14
|
server = klass.new(*@definition)
|
15
|
-
server.expects(:ask_the_socket).with("-T dn,ace -C US-ASCII domain.de", "whois.denic.de", 43
|
15
|
+
server.expects(:ask_the_socket).with("-T dn,ace -C US-ASCII domain.de", "whois.denic.de", 43).returns(response)
|
16
16
|
|
17
17
|
record = server.query("domain.de")
|
18
18
|
record.to_s.should == expected
|
@@ -33,7 +33,7 @@ describe Whois::Server::Adapters::Formatted do
|
|
33
33
|
it "sends the request to given port" do
|
34
34
|
response = "Whois Response"
|
35
35
|
server = klass.new(:tld, ".de", "whois.denic.de", { :format => "-T dn,ace -C US-ASCII %s", :port => 20 })
|
36
|
-
server.expects(:ask_the_socket).with("-T dn,ace -C US-ASCII domain.de", "whois.denic.de", 20
|
36
|
+
server.expects(:ask_the_socket).with("-T dn,ace -C US-ASCII domain.de", "whois.denic.de", 20).returns(response)
|
37
37
|
|
38
38
|
server.query("domain.de")
|
39
39
|
end
|
@@ -43,8 +43,8 @@ describe Whois::Server::Adapters::Formatted do
|
|
43
43
|
it "binds the request to given host and port" do
|
44
44
|
response = "Whois Response"
|
45
45
|
server = klass.new(:tld, ".de", "whois.denic.de", { :format => "-T dn,ace -C US-ASCII %s" })
|
46
|
-
server.configure(:bind_host => "192.168.
|
47
|
-
server.expects(:ask_the_socket).with("-T dn,ace -C US-ASCII domain.de", "whois.denic.de", 43, "192.168.
|
46
|
+
server.configure(:bind_host => "192.168.1.1", :bind_port => 3000)
|
47
|
+
server.expects(:ask_the_socket).with("-T dn,ace -C US-ASCII domain.de", "whois.denic.de", 43, "192.168.1.1", 3000).returns(response)
|
48
48
|
|
49
49
|
server.query("domain.de")
|
50
50
|
end
|
@@ -13,7 +13,7 @@ describe Whois::Server::Adapters::Pir do
|
|
13
13
|
it "returns the WHOIS record" do
|
14
14
|
response = "No match for DOMAIN.TEST."
|
15
15
|
expected = response
|
16
|
-
@server.expects(:ask_the_socket).with("FULL domain.test", "whois.publicinterestregistry.net", 43
|
16
|
+
@server.expects(:ask_the_socket).with("FULL domain.test", "whois.publicinterestregistry.net", 43).returns(response)
|
17
17
|
|
18
18
|
record = @server.query("domain.test")
|
19
19
|
record.to_s.should == expected
|
@@ -27,8 +27,8 @@ describe Whois::Server::Adapters::Pir do
|
|
27
27
|
referral = File.read(fixture("referrals/pir.org.txt"))
|
28
28
|
response = "Match for DOMAIN.TEST."
|
29
29
|
expected = referral + "\n" + response
|
30
|
-
@server.expects(:ask_the_socket).with("FULL domain.test", "whois.publicinterestregistry.net", 43
|
31
|
-
@server.expects(:ask_the_socket).with("domain.test", "whois.iana.org", 43
|
30
|
+
@server.expects(:ask_the_socket).with("FULL domain.test", "whois.publicinterestregistry.net", 43).returns(referral)
|
31
|
+
@server.expects(:ask_the_socket).with("domain.test", "whois.iana.org", 43).returns(response)
|
32
32
|
|
33
33
|
record = @server.query("domain.test")
|
34
34
|
record.to_s.should == expected
|
@@ -12,7 +12,7 @@ describe Whois::Server::Adapters::Standard do
|
|
12
12
|
response = "Whois Response"
|
13
13
|
expected = response
|
14
14
|
server = klass.new(*@definition)
|
15
|
-
server.expects(:ask_the_socket).with("domain.test", "whois.test", 43
|
15
|
+
server.expects(:ask_the_socket).with("domain.test", "whois.test", 43).returns(response)
|
16
16
|
|
17
17
|
record = server.query("domain.test")
|
18
18
|
record.to_s.should == expected
|
@@ -23,7 +23,7 @@ describe Whois::Server::Adapters::Standard do
|
|
23
23
|
it "sends the request to given port" do
|
24
24
|
response = "Whois Response"
|
25
25
|
server = klass.new(:tld, ".test", "whois.test", { :port => 20 })
|
26
|
-
server.expects(:ask_the_socket).with("domain.test", "whois.test", 20
|
26
|
+
server.expects(:ask_the_socket).with("domain.test", "whois.test", 20).returns(response)
|
27
27
|
|
28
28
|
server.query("domain.test")
|
29
29
|
end
|
@@ -33,8 +33,8 @@ describe Whois::Server::Adapters::Standard do
|
|
33
33
|
it "binds the request to given host and port" do
|
34
34
|
response = "Whois Response"
|
35
35
|
server = klass.new(:tld, ".test", "whois.test", { :port => 20 })
|
36
|
-
server.configure(:bind_host => "192.168.
|
37
|
-
server.expects(:ask_the_socket).with("domain.test", "whois.test", 20, "192.168.
|
36
|
+
server.configure(:bind_host => "192.168.1.100", :bind_port => 3000)
|
37
|
+
server.expects(:ask_the_socket).with("domain.test", "whois.test", 20, "192.168.1.100", 3000).returns(response)
|
38
38
|
|
39
39
|
server.query("domain.test")
|
40
40
|
end
|