whois 1.0.11 → 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +9 -0
- data/Manifest +9 -0
- data/lib/whois/answer/parser/NOTES.txt +1 -1
- data/lib/whois/answer/parser/whois.cnnic.net.cn.rb +1 -1
- data/lib/whois/answer/parser/whois.dns.lu.rb +1 -1
- data/lib/whois/answer/parser/whois.jprs.jp.rb +82 -0
- data/lib/whois/answer/parser/whois.registry.in.rb +77 -0
- data/lib/whois/version.rb +1 -1
- data/test/answer/parser/jobswhois.verisign-grs.com_test.rb +1 -1
- data/test/answer/parser/whois.adamsnames.tc_test.rb +1 -1
- data/test/answer/parser/whois.aero_test.rb +1 -1
- data/test/answer/parser/whois.afilias-grs.info_test.rb +1 -1
- data/test/answer/parser/whois.afilias.info_test.rb +1 -1
- data/test/answer/parser/whois.ai_test.rb +1 -1
- data/test/answer/parser/whois.arnes.si_test.rb +1 -1
- data/test/answer/parser/whois.biz_test.rb +1 -1
- data/test/answer/parser/whois.cat_test.rb +1 -1
- data/test/answer/parser/whois.cira.ca_test.rb +1 -1
- data/test/answer/parser/whois.cnnic.cn_test.rb +1 -1
- data/test/answer/parser/whois.cnnic.net.cn_test.rb +1 -1
- data/test/answer/parser/whois.dk-hostmaster.dk_test.rb +1 -1
- data/test/answer/parser/whois.dns.be_test.rb +1 -1
- data/test/answer/parser/whois.dns.lu_test.rb +8 -1
- data/test/answer/parser/whois.domain-registry.nl_test.rb +1 -1
- data/test/answer/parser/whois.domainregistry.ie_test.rb +1 -1
- data/test/answer/parser/whois.domreg.lt_test.rb +1 -1
- data/test/answer/parser/whois.dotmobiregistry.net_test.rb +1 -1
- data/test/answer/parser/whois.educause.edu_test.rb +1 -1
- data/test/answer/parser/whois.eu.org_test.rb +1 -1
- data/test/answer/parser/whois.eu_test.rb +1 -1
- data/test/answer/parser/whois.hkdnr.net.hk_test.rb +1 -1
- data/test/answer/parser/whois.iana.org_test.rb +1 -1
- data/test/answer/parser/whois.isnic.is_test.rb +1 -1
- data/test/answer/parser/whois.jprs.jp_test.rb +86 -0
- data/test/answer/parser/whois.meregistry.net_test.rb +1 -1
- data/test/answer/parser/whois.museum_test.rb +1 -1
- data/test/answer/parser/whois.nic-se.se_test.rb +1 -1
- data/test/answer/parser/whois.nic.ac_test.rb +1 -1
- data/test/answer/parser/whois.nic.af_test.rb +1 -1
- data/test/answer/parser/whois.nic.ag_test.rb +1 -1
- data/test/answer/parser/whois.nic.asia_test.rb +1 -1
- data/test/answer/parser/whois.nic.at_test.rb +1 -1
- data/test/answer/parser/whois.nic.cd_test.rb +1 -1
- data/test/answer/parser/whois.nic.ch_test.rb +1 -1
- data/test/answer/parser/whois.nic.coop_test.rb +1 -1
- data/test/answer/parser/whois.nic.fr_test.rb +1 -1
- data/test/answer/parser/whois.nic.gl_test.rb +1 -1
- data/test/answer/parser/whois.nic.gov_test.rb +1 -1
- data/test/answer/parser/whois.nic.hu_test.rb +1 -1
- data/test/answer/parser/whois.nic.im_test.rb +1 -1
- data/test/answer/parser/whois.nic.io_test.rb +1 -1
- data/test/answer/parser/whois.nic.it_test.rb +1 -1
- data/test/answer/parser/whois.nic.lv_test.rb +1 -1
- data/test/answer/parser/whois.nic.ly_test.rb +1 -1
- data/test/answer/parser/whois.nic.mu_test.rb +1 -1
- data/test/answer/parser/whois.nic.mx_test.rb +1 -1
- data/test/answer/parser/whois.nic.name_test.rb +1 -1
- data/test/answer/parser/whois.nic.nu_test.rb +1 -1
- data/test/answer/parser/whois.nic.or.kr_test.rb +1 -1
- data/test/answer/parser/whois.nic.tl_test.rb +1 -1
- data/test/answer/parser/whois.nic.travel_test.rb +1 -1
- data/test/answer/parser/whois.nic.uk_test.rb +1 -1
- data/test/answer/parser/whois.nic.us_test.rb +1 -1
- data/test/answer/parser/whois.nic.ve_test.rb +1 -1
- data/test/answer/parser/whois.norid.no_test.rb +1 -1
- data/test/answer/parser/whois.pandi.or.id_test.rb +1 -1
- data/test/answer/parser/whois.register.bg_test.rb +1 -1
- data/test/answer/parser/whois.registro.br_test.rb +1 -1
- data/test/answer/parser/whois.registry.in_test.rb +69 -0
- data/test/answer/parser/whois.registrypro.pro_test.rb +1 -1
- data/test/answer/parser/whois.ripe.net_test.rb +1 -1
- data/test/answer/parser/whois.ripn.net_test.rb +1 -1
- data/test/answer/parser/whois.rotld.ro_test.rb +1 -1
- data/test/answer/parser/whois.samoanic.ws_test.rb +1 -1
- data/test/answer/parser/whois.srs.net.nz_test.rb +1 -1
- data/test/answer/parser/whois.za.net_test.rb +1 -1
- data/test/answer/parser/whois.za.org_test.rb +1 -1
- data/test/list_tld +2 -2
- data/test/testcases/responses/whois.dns.lu/property_nameservers_with_ip.txt +55 -0
- data/test/testcases/responses/whois.jprs.jp/available.txt +8 -0
- data/test/testcases/responses/whois.jprs.jp/registered.txt +30 -0
- data/test/testcases/responses/whois.registry.in/available.txt +1 -0
- data/test/testcases/responses/whois.registry.in/registered.txt +83 -0
- data/whois.gemspec +5 -5
- metadata +16 -3
@@ -0,0 +1,86 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'whois/answer/parser/whois.jprs.jp'
|
3
|
+
|
4
|
+
class AnswerParserWhoisJprsJpTest < Whois::Answer::Parser::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@klass = Whois::Answer::Parser::WhoisJprsJp
|
8
|
+
@host = "whois.jprs.jp"
|
9
|
+
end
|
10
|
+
|
11
|
+
|
12
|
+
def test_status
|
13
|
+
parser = @klass.new(load_part('/registered.txt'))
|
14
|
+
expected = "Active"
|
15
|
+
assert_equal expected, parser.status
|
16
|
+
assert_equal expected, parser.instance_eval { @status }
|
17
|
+
|
18
|
+
parser = @klass.new(load_part('/available.txt'))
|
19
|
+
expected = nil
|
20
|
+
assert_equal expected, parser.status
|
21
|
+
assert_equal expected, parser.instance_eval { @status }
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_available?
|
25
|
+
assert !@klass.new(load_part('/registered.txt')).available?
|
26
|
+
assert @klass.new(load_part('/available.txt')).available?
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_registered?
|
30
|
+
assert @klass.new(load_part('/registered.txt')).registered?
|
31
|
+
assert !@klass.new(load_part('/available.txt')).registered?
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
def test_created_on
|
36
|
+
parser = @klass.new(load_part('/registered.txt'))
|
37
|
+
expected = Time.parse("2005-05-30")
|
38
|
+
assert_equal expected, parser.created_on
|
39
|
+
assert_equal expected, parser.instance_eval { @created_on }
|
40
|
+
|
41
|
+
parser = @klass.new(load_part('/available.txt'))
|
42
|
+
expected = nil
|
43
|
+
assert_equal expected, parser.created_on
|
44
|
+
assert_equal expected, parser.instance_eval { @created_on }
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_updated_on
|
48
|
+
parser = @klass.new(load_part('/registered.txt'))
|
49
|
+
# TODO: timezone
|
50
|
+
# JST timezone is ignored by Time.parse
|
51
|
+
expected = Time.parse("2009-06-01 01:05:04 JST")
|
52
|
+
assert_equal expected, parser.updated_on
|
53
|
+
assert_equal expected, parser.instance_eval { @updated_on }
|
54
|
+
|
55
|
+
parser = @klass.new(load_part('/available.txt'))
|
56
|
+
expected = nil
|
57
|
+
assert_equal expected, parser.updated_on
|
58
|
+
assert_equal expected, parser.instance_eval { @updated_on }
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_expires_on
|
62
|
+
parser = @klass.new(load_part('/registered.txt'))
|
63
|
+
expected = Time.parse("2010-05-31")
|
64
|
+
assert_equal expected, parser.expires_on
|
65
|
+
assert_equal expected, parser.instance_eval { @expires_on }
|
66
|
+
|
67
|
+
parser = @klass.new(load_part('/available.txt'))
|
68
|
+
expected = nil
|
69
|
+
assert_equal expected, parser.expires_on
|
70
|
+
assert_equal expected, parser.instance_eval { @expires_on }
|
71
|
+
end
|
72
|
+
|
73
|
+
|
74
|
+
def test_nameservers
|
75
|
+
parser = @klass.new(load_part('/registered.txt'))
|
76
|
+
expected = %w( ns1.google.com ns2.google.com ns3.google.com ns4.google.com )
|
77
|
+
assert_equal expected, parser.nameservers
|
78
|
+
assert_equal expected, parser.instance_eval { @nameservers }
|
79
|
+
|
80
|
+
parser = @klass.new(load_part('/available.txt'))
|
81
|
+
expected = %w()
|
82
|
+
assert_equal expected, parser.nameservers
|
83
|
+
assert_equal expected, parser.instance_eval { @nameservers }
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'whois/answer/parser/whois.registry.in'
|
3
|
+
|
4
|
+
class AnswerParserWhoisRegistryInTest < Whois::Answer::Parser::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@klass = Whois::Answer::Parser::WhoisRegistryIn
|
8
|
+
@host = "whois.registry.in"
|
9
|
+
end
|
10
|
+
|
11
|
+
|
12
|
+
def test_status
|
13
|
+
parser = @klass.new(load_part('/registered.txt'))
|
14
|
+
expected = ["OK"]
|
15
|
+
assert_equal expected, parser.status
|
16
|
+
assert_equal expected, parser.instance_eval { @status }
|
17
|
+
|
18
|
+
parser = @klass.new(load_part('/available.txt'))
|
19
|
+
expected = []
|
20
|
+
assert_equal expected, parser.status
|
21
|
+
assert_equal expected, parser.instance_eval { @status }
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_available?
|
25
|
+
assert !@klass.new(load_part('/registered.txt')).available?
|
26
|
+
assert @klass.new(load_part('/available.txt')).available?
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_registered?
|
30
|
+
assert @klass.new(load_part('/registered.txt')).registered?
|
31
|
+
assert !@klass.new(load_part('/available.txt')).registered?
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
def test_created_on
|
36
|
+
assert_equal Time.parse("2005-02-14 20:35:14 UTC"),
|
37
|
+
@klass.new(load_part('/registered.txt')).created_on
|
38
|
+
assert_equal nil,
|
39
|
+
@klass.new(load_part('/available.txt')).created_on
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_updated_on
|
43
|
+
assert_equal Time.parse("2009-04-06 18:20:09 UTC"),
|
44
|
+
@klass.new(load_part('/registered.txt')).updated_on
|
45
|
+
assert_equal nil,
|
46
|
+
@klass.new(load_part('/available.txt')).updated_on
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_expires_on
|
50
|
+
assert_equal Time.parse("2011-02-14 20:35:14 UTC"),
|
51
|
+
@klass.new(load_part('/registered.txt')).expires_on
|
52
|
+
assert_equal nil,
|
53
|
+
@klass.new(load_part('/available.txt')).expires_on
|
54
|
+
end
|
55
|
+
|
56
|
+
|
57
|
+
def test_nameservers
|
58
|
+
parser = @klass.new(load_part('/registered.txt'))
|
59
|
+
expected = %w( ns1.google.com ns2.google.com ns3.google.com ns4.google.com )
|
60
|
+
assert_equal expected, parser.nameservers
|
61
|
+
assert_equal expected, parser.instance_eval { @nameservers }
|
62
|
+
|
63
|
+
parser = @klass.new(load_part('/available.txt'))
|
64
|
+
expected = %w()
|
65
|
+
assert_equal expected, parser.nameservers
|
66
|
+
assert_equal expected, parser.instance_eval { @nameservers }
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|