whois 1.0.12 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +16 -1
- data/Manifest +24 -4
- data/lib/whois.rb +5 -5
- data/lib/whois/answer.rb +6 -2
- data/lib/whois/answer/contact.rb +18 -17
- data/lib/whois/answer/parser.rb +16 -1
- data/lib/whois/answer/parser/base.rb +40 -4
- data/lib/whois/answer/parser/whois.ausregistry.net.au.rb +71 -0
- data/lib/whois/answer/parser/whois.denic.de.rb +6 -6
- data/lib/whois/answer/parser/whois.nic.ac.rb +3 -3
- data/lib/whois/answer/parser/whois.nic.am.rb +83 -0
- data/lib/whois/answer/parser/whois.nic.as.rb +73 -0
- data/lib/whois/answer/parser/whois.nic.hu.rb +7 -7
- data/lib/whois/answer/parser/whois.nic.it.rb +6 -6
- data/lib/whois/answer/parser/whois.nic.st.rb +81 -0
- data/lib/whois/answer/parser/whois.publicinterestregistry.net.rb +3 -3
- data/lib/whois/version.rb +2 -2
- data/test/answer/contact_test.rb +14 -0
- data/test/answer/parser/base_test.rb +18 -0
- data/test/answer/parser/whois.ausregistry.net.au_test.rb +70 -0
- data/test/answer/parser/whois.denic.de_test.rb +65 -44
- data/test/answer/parser/whois.eu_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 +13 -13
- data/test/answer/parser/whois.nic.am_test.rb +84 -0
- data/test/answer/parser/whois.nic.as_test.rb +63 -0
- data/test/answer/parser/whois.nic.hu_test.rb +45 -35
- data/test/answer/parser/whois.nic.it_test.rb +92 -65
- data/test/answer/parser/whois.nic.st_test.rb +77 -0
- data/test/answer/parser/whois.publicinterestregistry.net_test.rb +26 -20
- data/test/answer/parser_test.rb +45 -0
- data/test/answer_test.rb +7 -0
- data/test/list_tld +4 -4
- data/test/testcases/responses/whois.ausregistry.net.au/available.txt +1 -0
- data/test/testcases/responses/whois.ausregistry.net.au/registered.txt +23 -0
- data/test/testcases/responses/whois.denic.de/{nameservers_with_ip.txt → property_nameservers_with_ip.txt} +0 -0
- data/test/testcases/responses/whois.denic.de/property_technical_contact.txt +70 -0
- data/test/testcases/responses/whois.eu/{nameservers_with_ip.txt → property_nameservers_with_ip.txt} +0 -0
- data/test/testcases/responses/whois.nic-se.se/{nameservers_with_ip.txt → property_nameservers_with_ip.txt} +0 -0
- data/test/testcases/responses/whois.nic.am/available.txt +3 -0
- data/test/testcases/responses/whois.nic.am/registered.txt +42 -0
- data/test/testcases/responses/whois.nic.as/available.txt +12 -0
- data/test/testcases/responses/whois.nic.as/registered.txt +18 -0
- data/test/testcases/responses/whois.nic.it/property_admin_contact.txt +53 -0
- data/test/testcases/responses/whois.nic.it/{contact.txt → property_registrant_contact.txt} +0 -0
- data/test/testcases/responses/whois.nic.it/property_technical_contact.txt +53 -0
- data/test/testcases/responses/whois.nic.st/available.txt +1 -0
- data/test/testcases/responses/whois.nic.st/registered.txt +47 -0
- data/whois.gemspec +5 -5
- metadata +36 -7
@@ -135,46 +135,67 @@ http://www.denic.de/en/background/whois-service/webwhois.html
|
|
135
135
|
@klass.new(load_part('/available.txt')).registrar
|
136
136
|
end
|
137
137
|
|
138
|
-
def
|
139
|
-
|
140
|
-
|
138
|
+
def test_registrant_contact_with_registered
|
139
|
+
parser = @klass.new(load_part('/registered.txt'))
|
140
|
+
expected = nil
|
141
|
+
assert_equal expected, parser.registrant_contact
|
142
|
+
assert_equal expected, parser.instance_eval { @registrant_contact }
|
141
143
|
end
|
142
144
|
|
143
|
-
def
|
144
|
-
|
145
|
-
|
145
|
+
def test_registrant_contact_with_available
|
146
|
+
parser = @klass.new(load_part('/available.txt'))
|
147
|
+
expected = nil
|
148
|
+
assert_equal expected, parser.registrant_contact
|
149
|
+
assert_equal expected, parser.instance_eval { @registrant_contact }
|
146
150
|
end
|
147
151
|
|
148
|
-
def
|
149
|
-
|
150
|
-
|
152
|
+
def test_admin_contact_with_registered
|
153
|
+
parser = @klass.new(load_part('/registered.txt'))
|
154
|
+
expected = nil
|
155
|
+
assert_equal expected, parser.admin_contact
|
156
|
+
assert_equal expected, parser.instance_eval { @admin_contact }
|
151
157
|
end
|
152
158
|
|
153
|
-
def
|
154
|
-
|
155
|
-
|
159
|
+
def test_admin_contact_with_available
|
160
|
+
parser = @klass.new(load_part('/available.txt'))
|
161
|
+
expected = nil
|
162
|
+
assert_equal expected, parser.admin_contact
|
163
|
+
assert_equal expected, parser.instance_eval { @admin_contact }
|
156
164
|
end
|
157
165
|
|
158
|
-
def
|
159
|
-
|
160
|
-
|
161
|
-
assert_equal
|
162
|
-
assert_equal
|
163
|
-
|
164
|
-
|
165
|
-
assert_equal('Mountain View', contact.city)
|
166
|
-
assert_equal(nil, contact.state)
|
167
|
-
assert_equal('94043', contact.zip)
|
168
|
-
assert_equal(nil, contact.country)
|
169
|
-
assert_equal('US', contact.country_code)
|
170
|
-
assert_equal('+1-6503300100', contact.phone)
|
171
|
-
assert_equal('+1-6506188571', contact.fax)
|
172
|
-
assert_equal('dns-admin@google.com', contact.email)
|
166
|
+
def test_technical_contact_with_registered
|
167
|
+
parser = @klass.new(load_part('/registered.txt'))
|
168
|
+
expected = parser.technical_contact
|
169
|
+
assert_equal expected, parser.technical_contact
|
170
|
+
assert_equal expected, parser.instance_eval { @technical_contact }
|
171
|
+
|
172
|
+
assert_instance_of Whois::Answer::Contact, expected
|
173
173
|
end
|
174
174
|
|
175
|
-
def
|
176
|
-
|
177
|
-
|
175
|
+
def test_technical_contact_with_available
|
176
|
+
parser = @klass.new(load_part('/available.txt'))
|
177
|
+
expected = nil
|
178
|
+
assert_equal expected, parser.technical_contact
|
179
|
+
assert_equal expected, parser.instance_eval { @technical_contact }
|
180
|
+
end
|
181
|
+
|
182
|
+
def test_technical_contact
|
183
|
+
parser = @klass.new(load_part('/property_technical_contact.txt'))
|
184
|
+
result = parser.technical_contact
|
185
|
+
|
186
|
+
assert_instance_of Whois::Answer::Contact, result
|
187
|
+
assert_equal nil, result.id
|
188
|
+
assert_equal 'Google Inc.', result.name
|
189
|
+
assert_equal nil, result.organization
|
190
|
+
assert_equal ['Google Inc.', '1600 Amphitheatre Parkway'], result.address
|
191
|
+
assert_equal 'Mountain View', result.city
|
192
|
+
assert_equal nil, result.state
|
193
|
+
assert_equal '94043', result.zip
|
194
|
+
assert_equal nil, result.country
|
195
|
+
assert_equal 'US', result.country_code
|
196
|
+
assert_equal '+1-6503300100', result.phone
|
197
|
+
assert_equal '+1-6506188571', result.fax
|
198
|
+
assert_equal 'dns-admin@google.com', result.email
|
178
199
|
end
|
179
200
|
|
180
201
|
|
@@ -191,7 +212,7 @@ http://www.denic.de/en/background/whois-service/webwhois.html
|
|
191
212
|
end
|
192
213
|
|
193
214
|
def test_nameservers_with_ip
|
194
|
-
parser = @klass.new(load_part('/
|
215
|
+
parser = @klass.new(load_part('/property_nameservers_with_ip.txt'))
|
195
216
|
expected = %w( ns1.prodns.de ns2.prodns.de ns3.prodns.de )
|
196
217
|
assert_equal expected, parser.nameservers
|
197
218
|
assert_equal expected, parser.instance_eval { @nameservers }
|
@@ -296,7 +317,7 @@ assurance and to bar you from using its whois query.
|
|
296
317
|
end
|
297
318
|
|
298
319
|
|
299
|
-
def
|
320
|
+
def test_registrar_with_registered
|
300
321
|
registrar = @klass.new(load_part('/1-10-0_registered.txt')).registrar
|
301
322
|
assert_instance_of(Whois::Answer::Registrar, registrar)
|
302
323
|
assert_equal(nil, registrar.id)
|
@@ -310,8 +331,8 @@ assurance and to bar you from using its whois query.
|
|
310
331
|
@klass.new(load_part('/1-10-0_available.txt')).registrar
|
311
332
|
end
|
312
333
|
|
313
|
-
def
|
314
|
-
contact = @klass.new(load_part('/1-10-0_registered.txt')).
|
334
|
+
def test_registrant_contact_with_registered
|
335
|
+
contact = @klass.new(load_part('/1-10-0_registered.txt')).registrant_contact
|
315
336
|
assert_instance_of(Whois::Answer::Contact, contact)
|
316
337
|
assert_equal(nil, contact.id)
|
317
338
|
assert_equal('Google Inc.', contact.name)
|
@@ -327,13 +348,13 @@ assurance and to bar you from using its whois query.
|
|
327
348
|
assert_equal(nil, contact.email)
|
328
349
|
end
|
329
350
|
|
330
|
-
def
|
351
|
+
def test_registrant_contact_with_available
|
331
352
|
assert_equal nil,
|
332
|
-
@klass.new(load_part('/1-10-0_available.txt')).
|
353
|
+
@klass.new(load_part('/1-10-0_available.txt')).registrant_contact
|
333
354
|
end
|
334
355
|
|
335
|
-
def
|
336
|
-
contact = @klass.new(load_part('/1-10-0_registered.txt')).
|
356
|
+
def test_admin_contact_with_registered
|
357
|
+
contact = @klass.new(load_part('/1-10-0_registered.txt')).admin_contact
|
337
358
|
assert_instance_of(Whois::Answer::Contact, contact)
|
338
359
|
assert_equal(nil, contact.id)
|
339
360
|
assert_equal('Lena Tangermann', contact.name)
|
@@ -349,13 +370,13 @@ assurance and to bar you from using its whois query.
|
|
349
370
|
assert_equal(nil, contact.email)
|
350
371
|
end
|
351
372
|
|
352
|
-
def
|
373
|
+
def test_admin_contact_with_available
|
353
374
|
assert_equal nil,
|
354
|
-
@klass.new(load_part('/1-10-0_available.txt')).
|
375
|
+
@klass.new(load_part('/1-10-0_available.txt')).admin_contact
|
355
376
|
end
|
356
377
|
|
357
|
-
def
|
358
|
-
contact = @klass.new(load_part('/1-10-0_registered.txt')).
|
378
|
+
def test_technical_contact_with_registered
|
379
|
+
contact = @klass.new(load_part('/1-10-0_registered.txt')).technical_contact
|
359
380
|
assert_instance_of(Whois::Answer::Contact, contact)
|
360
381
|
assert_equal(nil, contact.id)
|
361
382
|
assert_equal('Google Inc.', contact.name)
|
@@ -371,9 +392,9 @@ assurance and to bar you from using its whois query.
|
|
371
392
|
assert_equal('dns-admin@google.com', contact.email)
|
372
393
|
end
|
373
394
|
|
374
|
-
def
|
395
|
+
def test_technical_contact_with_available
|
375
396
|
assert_equal nil,
|
376
|
-
@klass.new(load_part('/1-10-0_available.txt')).
|
397
|
+
@klass.new(load_part('/1-10-0_available.txt')).technical_contact
|
377
398
|
end
|
378
399
|
|
379
400
|
|
@@ -56,7 +56,7 @@ class AnswerParserWhoisEuTest < Whois::Answer::Parser::TestCase
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def test_nameservers_with_ip
|
59
|
-
parser = @klass.new(load_part('/
|
59
|
+
parser = @klass.new(load_part('/property_nameservers_with_ip.txt'))
|
60
60
|
expected = %w( dns1.servicemagic.eu dns2.servicemagic.eu )
|
61
61
|
assert_equal expected, parser.nameservers
|
62
62
|
assert_equal expected, parser.instance_eval { @nameservers }
|
@@ -62,7 +62,7 @@ class AnswerParserWhoisNicSeSeTest < Whois::Answer::Parser::TestCase
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def test_nameservers_with_ip
|
65
|
-
parser = @klass.new(load_part('/
|
65
|
+
parser = @klass.new(load_part('/property_nameservers_with_ip.txt'))
|
66
66
|
expected = %w( ns2.loopia.se ns4.loopia.se ns3.loopia.se ns1.loopia.se )
|
67
67
|
assert_equal expected, parser.nameservers
|
68
68
|
assert_equal expected, parser.instance_eval { @nameservers }
|
@@ -13,12 +13,12 @@ class AnswerParserWhoisNicAcTest < Whois::Answer::Parser::TestCase
|
|
13
13
|
parser = @klass.new(load_part('/registered.txt'))
|
14
14
|
expected = "google.ac"
|
15
15
|
assert_equal expected, parser.domain
|
16
|
-
assert_equal expected, parser.
|
16
|
+
assert_equal expected, parser.instance_eval { @domain }
|
17
17
|
|
18
18
|
parser = @klass.new(load_part('/available.txt'))
|
19
19
|
expected = "u34jedzcq.ac"
|
20
20
|
assert_equal expected, parser.domain
|
21
|
-
assert_equal expected, parser.
|
21
|
+
assert_equal expected, parser.instance_eval { @domain }
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_domain_id
|
@@ -31,12 +31,12 @@ class AnswerParserWhoisNicAcTest < Whois::Answer::Parser::TestCase
|
|
31
31
|
parser = @klass.new(load_part('/registered.txt'))
|
32
32
|
expected = :registered
|
33
33
|
assert_equal expected, parser.status
|
34
|
-
assert_equal expected, parser.
|
34
|
+
assert_equal expected, parser.instance_eval { @status }
|
35
35
|
|
36
36
|
parser = @klass.new(load_part('/available.txt'))
|
37
37
|
expected = :available
|
38
38
|
assert_equal expected, parser.status
|
39
|
-
assert_equal expected, parser.
|
39
|
+
assert_equal expected, parser.instance_eval { @status }
|
40
40
|
end
|
41
41
|
|
42
42
|
def test_available?
|
@@ -71,19 +71,19 @@ class AnswerParserWhoisNicAcTest < Whois::Answer::Parser::TestCase
|
|
71
71
|
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).registrar }
|
72
72
|
end
|
73
73
|
|
74
|
-
def
|
75
|
-
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).
|
76
|
-
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).
|
74
|
+
def test_registrant_contact
|
75
|
+
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).registrant_contact }
|
76
|
+
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).registrant_contact }
|
77
77
|
end
|
78
78
|
|
79
|
-
def
|
80
|
-
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).
|
81
|
-
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).
|
79
|
+
def test_admin_contact
|
80
|
+
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).admin_contact }
|
81
|
+
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).admin_contact }
|
82
82
|
end
|
83
83
|
|
84
|
-
def
|
85
|
-
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).
|
86
|
-
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).
|
84
|
+
def test_technical_contact
|
85
|
+
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).technical_contact }
|
86
|
+
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).technical_contact }
|
87
87
|
end
|
88
88
|
|
89
89
|
|
@@ -0,0 +1,84 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'whois/answer/parser/whois.nic.am'
|
3
|
+
|
4
|
+
class AnswerParserWhoisNicAmTest < Whois::Answer::Parser::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@klass = Whois::Answer::Parser::WhoisNicAm
|
8
|
+
@host = "whois.nic.am"
|
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("1999-06-05")
|
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
|
+
expected = Time.parse("2010-03-16")
|
50
|
+
assert_equal expected, parser.updated_on
|
51
|
+
assert_equal expected, parser.instance_eval { @updated_on }
|
52
|
+
|
53
|
+
parser = @klass.new(load_part('/available.txt'))
|
54
|
+
expected = nil
|
55
|
+
assert_equal expected, parser.updated_on
|
56
|
+
assert_equal expected, parser.instance_eval { @updated_on }
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_expires_on
|
60
|
+
parser = @klass.new(load_part('/registered.txt'))
|
61
|
+
expected = Time.parse("2011-04-15")
|
62
|
+
assert_equal expected, parser.expires_on
|
63
|
+
assert_equal expected, parser.instance_eval { @expires_on }
|
64
|
+
|
65
|
+
parser = @klass.new(load_part('/available.txt'))
|
66
|
+
expected = nil
|
67
|
+
assert_equal expected, parser.expires_on
|
68
|
+
assert_equal expected, parser.instance_eval { @expires_on }
|
69
|
+
end
|
70
|
+
|
71
|
+
|
72
|
+
def test_nameservers
|
73
|
+
parser = @klass.new(load_part('/registered.txt'))
|
74
|
+
expected = %w( ns1.google.com ns2.google.com ns3.google.com ns4.google.com )
|
75
|
+
assert_equal expected, parser.nameservers
|
76
|
+
assert_equal expected, parser.instance_eval { @nameservers }
|
77
|
+
|
78
|
+
parser = @klass.new(load_part('/available.txt'))
|
79
|
+
expected = %w()
|
80
|
+
assert_equal expected, parser.nameservers
|
81
|
+
assert_equal expected, parser.instance_eval { @nameservers }
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'whois/answer/parser/whois.nic.as'
|
3
|
+
|
4
|
+
class AnswerParserWhoisNicAsTest < Whois::Answer::Parser::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@klass = Whois::Answer::Parser::WhoisNicAs
|
8
|
+
@host = "whois.nic.as"
|
9
|
+
end
|
10
|
+
|
11
|
+
|
12
|
+
def test_status
|
13
|
+
parser = @klass.new(load_part('/registered.txt'))
|
14
|
+
expected = :registered
|
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 = :available
|
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_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).created_on }
|
37
|
+
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).created_on }
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_updated_on
|
41
|
+
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).updated_on }
|
42
|
+
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).updated_on }
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_expires_on
|
46
|
+
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).expires_on }
|
47
|
+
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).expires_on }
|
48
|
+
end
|
49
|
+
|
50
|
+
|
51
|
+
def test_nameservers
|
52
|
+
parser = @klass.new(load_part('/registered.txt'))
|
53
|
+
expected = %w( ns1.google.com ns2.google.com ns3.google.com ns4.google.com )
|
54
|
+
assert_equal expected, parser.nameservers
|
55
|
+
assert_equal expected, parser.instance_eval { @nameservers }
|
56
|
+
|
57
|
+
parser = @klass.new(load_part('/available.txt'))
|
58
|
+
expected = %w()
|
59
|
+
assert_equal expected, parser.nameservers
|
60
|
+
assert_equal expected, parser.instance_eval { @nameservers }
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
@@ -113,29 +113,29 @@ EOS
|
|
113
113
|
end
|
114
114
|
|
115
115
|
|
116
|
-
def
|
117
|
-
parser
|
118
|
-
|
119
|
-
assert_instance_of Whois::Answer::Contact,
|
120
|
-
assert_equal
|
121
|
-
assert_equal
|
116
|
+
def test_registrant_contact_with_registered
|
117
|
+
parser = @klass.new(load_part('/registered.txt'))
|
118
|
+
expected = parser.registrant_contact
|
119
|
+
assert_instance_of Whois::Answer::Contact, expected
|
120
|
+
assert_equal expected, parser.registrant_contact
|
121
|
+
assert_equal expected, parser.instance_eval { @registrant_contact }
|
122
122
|
end
|
123
123
|
|
124
|
-
def
|
125
|
-
parser
|
126
|
-
|
127
|
-
assert_equal
|
128
|
-
assert_equal
|
124
|
+
def test_registrant_contact_with_unregistered
|
125
|
+
parser = @klass.new(load_part('/available.txt'))
|
126
|
+
expected = nil
|
127
|
+
assert_equal expected, parser.registrant_contact
|
128
|
+
assert_equal expected, parser.instance_eval { @registrant_contact }
|
129
129
|
|
130
|
-
parser
|
131
|
-
|
132
|
-
assert_equal
|
133
|
-
assert_equal
|
130
|
+
parser = @klass.new(load_part('/in_progress.txt'))
|
131
|
+
expected = nil
|
132
|
+
assert_equal expected, parser.registrant_contact
|
133
|
+
assert_equal expected, parser.instance_eval { @registrant }
|
134
134
|
end
|
135
135
|
|
136
|
-
def
|
136
|
+
def test_registrant_contact_as_company
|
137
137
|
parser = @klass.new(load_part('/property_registrant_as_company.txt'))
|
138
|
-
result = parser.
|
138
|
+
result = parser.registrant_contact
|
139
139
|
|
140
140
|
assert_instance_of Whois::Answer::Contact, result
|
141
141
|
assert_equal 'Google, Inc.', result.name
|
@@ -148,9 +148,9 @@ EOS
|
|
148
148
|
assert_equal '+1 650 253 0001', result.fax
|
149
149
|
end
|
150
150
|
|
151
|
-
def
|
151
|
+
def test_registrant_contact_as_private_person
|
152
152
|
parser = @klass.new(load_part('/property_registrant_as_private_person.txt'))
|
153
|
-
result = parser.
|
153
|
+
result = parser.registrant_contact
|
154
154
|
|
155
155
|
assert_instance_of Whois::Answer::Contact, result
|
156
156
|
assert_match /Buruzs/, result.name # UTF-8 hack
|
@@ -163,9 +163,9 @@ EOS
|
|
163
163
|
assert_equal nil, result.fax
|
164
164
|
end
|
165
165
|
|
166
|
-
def
|
166
|
+
def test_registrant_contact_without_address
|
167
167
|
parser = @klass.new(load_part('/property_registrant_without_address.txt'))
|
168
|
-
result = parser.
|
168
|
+
result = parser.registrant_contact
|
169
169
|
|
170
170
|
assert_equal nil, result.address
|
171
171
|
assert_equal nil, result.zip
|
@@ -173,8 +173,8 @@ EOS
|
|
173
173
|
assert_equal nil, result.country_code
|
174
174
|
end
|
175
175
|
|
176
|
-
def
|
177
|
-
admin = @klass.new(load_part('/registered.txt')).
|
176
|
+
def test_admin_contact_with_registered
|
177
|
+
admin = @klass.new(load_part('/registered.txt')).admin_contact
|
178
178
|
assert_instance_of Whois::Answer::Contact, admin
|
179
179
|
assert_equal '2000466366', admin.id
|
180
180
|
assert_equal '3C Kft. (Registrar)', admin.name
|
@@ -186,15 +186,20 @@ EOS
|
|
186
186
|
assert_equal '+36 1 275 58 87', admin.fax
|
187
187
|
end
|
188
188
|
|
189
|
-
def
|
190
|
-
|
191
|
-
|
192
|
-
assert_equal
|
193
|
-
|
189
|
+
def test_admin_contact_with_unregistered
|
190
|
+
parser = @klass.new(load_part('/available.txt'))
|
191
|
+
expected = nil
|
192
|
+
assert_equal expected, parser.admin_contact
|
193
|
+
assert_equal expected, parser.instance_eval { @admin_contact }
|
194
|
+
|
195
|
+
parser = @klass.new(load_part('/in_progress.txt'))
|
196
|
+
expected = nil
|
197
|
+
assert_equal expected, parser.admin_contact
|
198
|
+
assert_equal expected, parser.instance_eval { @admin_contact }
|
194
199
|
end
|
195
200
|
|
196
|
-
def
|
197
|
-
technical = @klass.new(load_part('/registered.txt')).
|
201
|
+
def test_technical_contact_with_registered
|
202
|
+
technical = @klass.new(load_part('/registered.txt')).technical_contact
|
198
203
|
assert_instance_of Whois::Answer::Contact, technical
|
199
204
|
assert_equal '2000578125', technical.id
|
200
205
|
assert_equal 'Markmonitor', technical.name
|
@@ -207,11 +212,16 @@ EOS
|
|
207
212
|
assert_equal 'ccops@markmonitor.com', technical.email
|
208
213
|
end
|
209
214
|
|
210
|
-
def
|
211
|
-
|
212
|
-
|
213
|
-
assert_equal
|
214
|
-
|
215
|
+
def test_technical_contact_with_unregistered
|
216
|
+
parser = @klass.new(load_part('/available.txt'))
|
217
|
+
expected = nil
|
218
|
+
assert_equal expected, parser.technical_contact
|
219
|
+
assert_equal expected, parser.instance_eval { @technical_contact }
|
220
|
+
|
221
|
+
parser = @klass.new(load_part('/in_progress.txt'))
|
222
|
+
expected = nil
|
223
|
+
assert_equal expected, parser.technical_contact
|
224
|
+
assert_equal expected, parser.instance_eval { @technical_contact }
|
215
225
|
end
|
216
226
|
|
217
227
|
|