whois 0.9.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (262) hide show
  1. data/CHANGELOG.rdoc +161 -21
  2. data/LICENSE.rdoc +1 -1
  3. data/Manifest +184 -13
  4. data/README.rdoc +24 -31
  5. data/Rakefile +7 -7
  6. data/bin/ruby-whois +9 -3
  7. data/data/ip_del_list +2 -0
  8. data/data/make_servers_charset.pl +21 -0
  9. data/data/make_tld_serv.pl +8 -7
  10. data/data/servers_charset_list +37 -0
  11. data/data/tld_serv_list +32 -30
  12. data/lib/whois.rb +0 -1
  13. data/lib/whois/answer.rb +24 -13
  14. data/lib/whois/answer/parser.rb +27 -16
  15. data/lib/whois/answer/parser/NOTES.txt +3 -0
  16. data/lib/whois/answer/parser/base.rb +140 -101
  17. data/lib/whois/answer/parser/jobswhois.verisign-grs.com.rb +99 -0
  18. data/lib/whois/answer/parser/whois.adamsnames.tc.rb +64 -0
  19. data/lib/whois/answer/parser/whois.aeda.net.ae.rb +65 -0
  20. data/lib/whois/answer/parser/whois.aero.rb +6 -6
  21. data/lib/whois/answer/parser/whois.afilias-grs.info.rb +6 -6
  22. data/lib/whois/answer/parser/whois.afilias.info.rb +12 -12
  23. data/lib/whois/answer/parser/whois.biz.rb +72 -0
  24. data/lib/whois/answer/parser/whois.cat.rb +74 -0
  25. data/lib/whois/answer/parser/whois.cira.ca.rb +77 -0
  26. data/lib/whois/answer/parser/whois.crsnic.net.rb +16 -13
  27. data/lib/whois/answer/parser/whois.denic.de.rb +14 -18
  28. data/lib/whois/answer/parser/whois.dk-hostmaster.dk.rb +75 -0
  29. data/lib/whois/answer/parser/whois.domain-registry.nl.rb +72 -0
  30. data/lib/whois/answer/parser/whois.domainregistry.ie.rb +7 -13
  31. data/lib/whois/answer/parser/whois.dotmobiregistry.net.rb +72 -0
  32. data/lib/whois/answer/parser/whois.educause.edu.rb +8 -8
  33. data/lib/whois/answer/parser/whois.eu.org.rb +8 -17
  34. data/lib/whois/answer/parser/whois.eu.rb +64 -0
  35. data/lib/whois/answer/parser/whois.iana.org.rb +6 -9
  36. data/lib/whois/answer/parser/whois.isnic.is.rb +72 -0
  37. data/lib/whois/answer/parser/whois.meregistry.net.rb +72 -0
  38. data/lib/whois/answer/parser/whois.museum.rb +76 -0
  39. data/lib/whois/answer/parser/whois.nic-se.se.rb +77 -0
  40. data/lib/whois/answer/parser/whois.nic.ac.rb +92 -0
  41. data/lib/whois/answer/parser/whois.nic.asia.rb +12 -12
  42. data/lib/whois/answer/parser/whois.nic.cc.rb +99 -0
  43. data/lib/whois/answer/parser/whois.nic.cd.rb +68 -0
  44. data/lib/whois/answer/parser/whois.nic.ch.rb +64 -0
  45. data/lib/whois/answer/parser/whois.nic.coop.rb +74 -0
  46. data/lib/whois/answer/parser/whois.nic.fr.rb +8 -11
  47. data/lib/whois/answer/parser/whois.nic.gl.rb +77 -0
  48. data/lib/whois/answer/parser/whois.nic.gov.rb +8 -17
  49. data/lib/whois/answer/parser/whois.nic.hu.rb +21 -19
  50. data/lib/whois/answer/parser/whois.nic.im.rb +68 -0
  51. data/lib/whois/answer/parser/whois.nic.io.rb +64 -0
  52. data/lib/whois/answer/parser/whois.nic.it.rb +16 -16
  53. data/lib/whois/answer/parser/whois.nic.ly.rb +76 -0
  54. data/lib/whois/answer/parser/whois.nic.mu.rb +77 -0
  55. data/lib/whois/answer/parser/whois.nic.name.rb +8 -17
  56. data/lib/whois/answer/parser/whois.nic.nu.rb +84 -0
  57. data/lib/whois/answer/parser/whois.nic.tel.rb +76 -0
  58. data/lib/whois/answer/parser/whois.nic.tl.rb +76 -0
  59. data/lib/whois/answer/parser/whois.nic.travel.rb +72 -0
  60. data/lib/whois/answer/parser/whois.nic.tv.rb +16 -13
  61. data/lib/whois/answer/parser/whois.nic.uk.rb +82 -0
  62. data/lib/whois/answer/parser/whois.nic.us.rb +72 -0
  63. data/lib/whois/answer/parser/whois.norid.no.rb +72 -0
  64. data/lib/whois/answer/parser/whois.publicinterestregistry.net.rb +16 -16
  65. data/lib/whois/answer/parser/whois.register.bg.rb +74 -0
  66. data/lib/whois/answer/parser/whois.registro.br.rb +64 -0
  67. data/lib/whois/answer/parser/whois.registrypro.pro.rb +77 -0
  68. data/lib/whois/answer/parser/whois.ripe.net.rb +64 -0
  69. data/lib/whois/answer/parser/whois.ripn.net.rb +72 -0
  70. data/lib/whois/answer/parser/whois.rotld.ro.rb +64 -0
  71. data/lib/whois/answer/parser/whois.samoanic.ws.rb +76 -0
  72. data/lib/whois/answer/parser/whois.za.net.rb +8 -11
  73. data/lib/whois/answer/parser/whois.za.org.rb +7 -10
  74. data/lib/whois/answer/super_struct.rb +1 -1
  75. data/lib/whois/client.rb +4 -4
  76. data/lib/whois/definitions/NOTES.txt +12 -0
  77. data/lib/whois/definitions/ipv4.rb +2 -0
  78. data/lib/whois/definitions/tlds.rb +27 -27
  79. data/lib/whois/errors.rb +11 -1
  80. data/lib/whois/server.rb +1 -0
  81. data/lib/whois/server/adapters/web.rb +1 -2
  82. data/lib/whois/version.rb +4 -4
  83. data/test/answer/parser/base_test.rb +16 -29
  84. data/test/answer/parser/jobswhois.verisign-grs.com_test.rb +122 -0
  85. data/test/answer/parser/whois.adamsnames.tc_test.rb +122 -0
  86. data/test/answer/parser/whois.aeda.net.ae_test.rb +63 -0
  87. data/test/answer/parser/whois.afilias-grs.info_test.rb +274 -13
  88. data/test/answer/parser/whois.afilias.info_test.rb +1 -1
  89. data/test/answer/parser/whois.biz_test.rb +51 -0
  90. data/test/answer/parser/whois.cat_test.rb +51 -0
  91. data/test/answer/parser/whois.cira.ca_test.rb +51 -0
  92. data/test/answer/parser/whois.crsnic.net_test.rb +8 -3
  93. data/test/answer/parser/whois.denic.de_test.rb +11 -18
  94. data/test/answer/parser/whois.dk-hostmaster.dk_test.rb +57 -0
  95. data/test/answer/parser/whois.domain-registry.nl_test.rb +49 -0
  96. data/test/answer/parser/whois.domainregistry.ie_test.rb +7 -11
  97. data/test/answer/parser/whois.dotmobiregistry.net_test.rb +51 -0
  98. data/test/answer/parser/whois.educause.edu_test.rb +3 -3
  99. data/test/answer/parser/whois.eu.org_test.rb +6 -12
  100. data/test/answer/parser/whois.eu_test.rb +45 -0
  101. data/test/answer/parser/whois.iana.org_test.rb +2 -4
  102. data/test/answer/parser/whois.isnic.is_test.rb +49 -0
  103. data/test/answer/parser/whois.meregistry.net_test.rb +51 -0
  104. data/test/answer/parser/whois.museum_test.rb +51 -0
  105. data/test/answer/parser/whois.nic-se.se_test.rb +58 -0
  106. data/test/answer/parser/whois.nic.ac_test.rb +126 -0
  107. data/test/answer/parser/whois.nic.asia_test.rb +1 -1
  108. data/test/answer/parser/whois.nic.cc_test.rb +122 -0
  109. data/test/answer/parser/whois.nic.cd_test.rb +49 -0
  110. data/test/answer/parser/whois.nic.ch_test.rb +45 -0
  111. data/test/answer/parser/whois.nic.coop_test.rb +51 -0
  112. data/test/answer/parser/whois.nic.fr_test.rb +178 -13
  113. data/test/answer/parser/whois.nic.gl_test.rb +51 -0
  114. data/test/answer/parser/whois.nic.gov_test.rb +6 -12
  115. data/test/answer/parser/whois.nic.hu_test.rb +9 -7
  116. data/test/answer/parser/whois.nic.im_test.rb +47 -0
  117. data/test/answer/parser/whois.nic.io_test.rb +45 -0
  118. data/test/answer/parser/whois.nic.it_test.rb +6 -3
  119. data/test/answer/parser/whois.nic.ly_test.rb +51 -0
  120. data/test/answer/parser/whois.nic.mu_test.rb +97 -0
  121. data/test/answer/parser/whois.nic.name_test.rb +6 -12
  122. data/test/answer/parser/whois.nic.nu_test.rb +59 -0
  123. data/test/answer/parser/whois.nic.tel_test.rb +51 -0
  124. data/test/answer/parser/whois.nic.tl_test.rb +51 -0
  125. data/test/answer/parser/whois.nic.travel_test.rb +51 -0
  126. data/test/answer/parser/whois.nic.tv_test.rb +9 -5
  127. data/test/answer/parser/whois.nic.uk_test.rb +63 -0
  128. data/test/answer/parser/whois.nic.us_test.rb +51 -0
  129. data/test/answer/parser/whois.norid.no_test.rb +49 -0
  130. data/test/answer/parser/whois.register.bg_test.rb +49 -0
  131. data/test/answer/parser/whois.registro.br_test.rb +45 -0
  132. data/test/answer/parser/whois.registrypro.pro_test.rb +84 -0
  133. data/test/answer/parser/whois.ripe.net_test.rb +203 -0
  134. data/test/answer/parser/whois.ripn.net_test.rb +94 -0
  135. data/test/answer/parser/whois.rotld.ro_test.rb +45 -0
  136. data/test/answer/parser/whois.samoanic.ws_test.rb +51 -0
  137. data/test/answer/parser/whois.za.net_test.rb +2 -4
  138. data/test/answer/parser/whois.za.org_test.rb +2 -4
  139. data/test/answer/parser_test.rb +71 -48
  140. data/test/answer_test.rb +57 -21
  141. data/test/client_test.rb +5 -2
  142. data/test/errors_test.rb +23 -0
  143. data/test/list_tld +74 -76
  144. data/test/testcases/responses/jobswhois.verisign-grs.com/available.txt +44 -0
  145. data/test/testcases/responses/jobswhois.verisign-grs.com/registered.txt +54 -0
  146. data/test/testcases/responses/super_struct_test.rb +3 -4
  147. data/test/testcases/responses/whois.adamsnames.tc/gd/available.txt +2 -0
  148. data/test/testcases/responses/whois.adamsnames.tc/gd/registered.txt +26 -0
  149. data/test/testcases/responses/whois.adamsnames.tc/tc/available.txt +2 -0
  150. data/test/testcases/responses/whois.adamsnames.tc/tc/registered.txt +28 -0
  151. data/test/testcases/responses/whois.adamsnames.tc/vg/available.txt +2 -0
  152. data/test/testcases/responses/whois.adamsnames.tc/vg/registered.txt +28 -0
  153. data/test/testcases/responses/whois.aeda.net.ae/available.txt +1 -0
  154. data/test/testcases/responses/whois.aeda.net.ae/registered.txt +15 -0
  155. data/test/testcases/responses/whois.biz/available.txt +25 -0
  156. data/test/testcases/responses/whois.biz/registered.txt +89 -0
  157. data/test/testcases/responses/whois.cat/available.txt +18 -0
  158. data/test/testcases/responses/whois.cat/registered.txt +83 -0
  159. data/test/testcases/responses/whois.cira.ca/available.txt +9 -0
  160. data/test/testcases/responses/whois.cira.ca/registered.txt +47 -0
  161. data/test/testcases/responses/whois.dk-hostmaster.dk/available.txt +15 -0
  162. data/test/testcases/responses/whois.dk-hostmaster.dk/registered.txt +47 -0
  163. data/test/testcases/responses/whois.domain-registry.nl/available.txt +21 -0
  164. data/test/testcases/responses/whois.domain-registry.nl/registered.txt +67 -0
  165. data/test/testcases/responses/whois.dotmobiregistry.net/available.txt +25 -0
  166. data/test/testcases/responses/whois.dotmobiregistry.net/registered.txt +81 -0
  167. data/test/testcases/responses/whois.eu/available.txt +47 -0
  168. data/test/testcases/responses/whois.eu/registered.txt +63 -0
  169. data/test/testcases/responses/whois.isnic.is/available.txt +7 -0
  170. data/test/testcases/responses/whois.isnic.is/registered.txt +57 -0
  171. data/test/testcases/responses/{whois.afilias-grs.info → whois.meregistry.net}/available.txt +0 -0
  172. data/test/testcases/responses/whois.meregistry.net/registered.txt +94 -0
  173. data/test/testcases/responses/whois.museum/available.txt +18 -0
  174. data/test/testcases/responses/whois.museum/registered.txt +92 -0
  175. data/test/testcases/responses/whois.nic-se.se/available.txt +21 -0
  176. data/test/testcases/responses/whois.nic-se.se/registered.txt +37 -0
  177. data/test/testcases/responses/whois.nic.ac/available.txt +2 -0
  178. data/test/testcases/responses/whois.nic.ac/registered.txt +2 -0
  179. data/test/testcases/responses/whois.nic.cc/available.txt +44 -0
  180. data/test/testcases/responses/whois.nic.cc/registered.txt +58 -0
  181. data/test/testcases/responses/whois.nic.cd/available.txt +1 -0
  182. data/test/testcases/responses/whois.nic.cd/registered.txt +85 -0
  183. data/test/testcases/responses/whois.nic.ch/available.txt +2 -0
  184. data/test/testcases/responses/whois.nic.ch/registered.txt +28 -0
  185. data/test/testcases/responses/whois.nic.coop/available.txt +33 -0
  186. data/test/testcases/responses/whois.nic.coop/registered.txt +123 -0
  187. data/test/testcases/responses/whois.nic.fr/{available.txt → fr/available.txt} +0 -0
  188. data/test/testcases/responses/whois.nic.fr/{registered.txt → fr/registered.txt} +0 -0
  189. data/test/testcases/responses/whois.nic.fr/pm/available.txt +19 -0
  190. data/test/testcases/responses/whois.nic.fr/pm/registered.txt +88 -0
  191. data/test/testcases/responses/whois.nic.fr/re/available.txt +19 -0
  192. data/test/testcases/responses/whois.nic.fr/re/registered.txt +83 -0
  193. data/test/testcases/responses/whois.nic.fr/wf/available.txt +19 -0
  194. data/test/testcases/responses/whois.nic.fr/wf/registered.txt +88 -0
  195. data/test/testcases/responses/whois.nic.fr/yt/available.txt +19 -0
  196. data/test/testcases/responses/whois.nic.fr/yt/registered.txt +88 -0
  197. data/test/testcases/responses/whois.nic.gl/available.txt +23 -0
  198. data/test/testcases/responses/whois.nic.gl/registered.txt +40 -0
  199. data/test/testcases/responses/whois.nic.hu/available.txt +5 -5
  200. data/test/testcases/responses/whois.nic.hu/in_progress.txt +5 -5
  201. data/test/testcases/responses/whois.nic.hu/registered.txt +6 -6
  202. data/test/testcases/responses/whois.nic.im/available.txt +2 -0
  203. data/test/testcases/responses/whois.nic.im/registered.txt +45 -0
  204. data/test/testcases/responses/whois.nic.io/available.txt +2 -0
  205. data/test/testcases/responses/whois.nic.io/registered.txt +2 -0
  206. data/test/testcases/responses/whois.nic.ly/available.txt +1 -0
  207. data/test/testcases/responses/whois.nic.ly/registered.txt +65 -0
  208. data/test/testcases/responses/whois.nic.mu/ki/available.txt +20 -0
  209. data/test/testcases/responses/whois.nic.mu/ki/registered.txt +30 -0
  210. data/test/testcases/responses/whois.nic.mu/mu/available.txt +9 -0
  211. data/test/testcases/responses/whois.nic.mu/mu/registered.txt +22 -0
  212. data/test/testcases/responses/whois.nic.nu/available.txt +19 -0
  213. data/test/testcases/responses/whois.nic.nu/registered.txt +35 -0
  214. data/test/testcases/responses/whois.nic.tel/available.txt +59 -0
  215. data/test/testcases/responses/whois.nic.tel/registered.txt +111 -0
  216. data/test/testcases/responses/whois.nic.tl/available.txt +21 -0
  217. data/test/testcases/responses/whois.nic.tl/registered.txt +29 -0
  218. data/test/testcases/responses/whois.nic.travel/available.txt +25 -0
  219. data/test/testcases/responses/whois.nic.travel/registered.txt +75 -0
  220. data/test/testcases/responses/whois.nic.uk/available.txt +20 -0
  221. data/test/testcases/responses/whois.nic.uk/invalid.txt +22 -0
  222. data/test/testcases/responses/whois.nic.uk/registered.txt +50 -0
  223. data/test/testcases/responses/whois.nic.us/available.txt +29 -0
  224. data/test/testcases/responses/whois.nic.us/registered.txt +99 -0
  225. data/test/testcases/responses/whois.norid.no/available.txt +5 -0
  226. data/test/testcases/responses/whois.norid.no/registered.txt +34 -0
  227. data/test/testcases/responses/whois.register.bg/available.txt +1 -0
  228. data/test/testcases/responses/whois.register.bg/registered.txt +44 -0
  229. data/test/testcases/responses/whois.registro.br/available.txt +22 -0
  230. data/test/testcases/responses/whois.registro.br/registered.txt +23 -0
  231. data/test/testcases/responses/whois.registrypro.pro/available.txt +20 -0
  232. data/test/testcases/responses/whois.registrypro.pro/registered.txt +62 -0
  233. data/test/testcases/responses/whois.ripe.net/fo/available.txt +11 -0
  234. data/test/testcases/responses/whois.ripe.net/fo/registered.txt +45 -0
  235. data/test/testcases/responses/whois.ripe.net/gm/available.txt +11 -0
  236. data/test/testcases/responses/whois.ripe.net/gm/registered.txt +37 -0
  237. data/test/testcases/responses/whois.ripe.net/mc/available.txt +11 -0
  238. data/test/testcases/responses/whois.ripe.net/mc/registered.txt +36 -0
  239. data/test/testcases/responses/whois.ripe.net/sm/available.txt +11 -0
  240. data/test/testcases/responses/whois.ripe.net/sm/registered.txt +60 -0
  241. data/test/testcases/responses/whois.ripe.net/va/available.txt +11 -0
  242. data/test/testcases/responses/whois.ripe.net/va/registered.txt +48 -0
  243. data/test/testcases/responses/whois.ripn.net/ru/available.txt +9 -0
  244. data/test/testcases/responses/whois.ripn.net/ru/registered.txt +24 -0
  245. data/test/testcases/responses/whois.ripn.net/su/available.txt +9 -0
  246. data/test/testcases/responses/whois.ripn.net/su/registered.txt +20 -0
  247. data/test/testcases/responses/whois.rotld.ro/available.txt +16 -0
  248. data/test/testcases/responses/whois.rotld.ro/registered.txt +27 -0
  249. data/test/testcases/responses/whois.samoanic.ws/available.txt +12 -0
  250. data/test/testcases/responses/whois.samoanic.ws/registered.txt +34 -0
  251. data/whois.gemspec +19 -19
  252. metadata +274 -31
  253. data/lib/whois/answer/parser/README.rdoc +0 -21
  254. data/lib/whois/definitions/ipv4.txt +0 -214
  255. data/lib/whois/definitions/ipv6.txt +0 -32
  256. data/lib/whois/definitions/tld.notes.txt +0 -1
  257. data/lib/whois/definitions/tlds.txt +0 -354
  258. data/lib/whois/whois.rb +0 -185
  259. data/test/testcases/responses/whois.afilias-grs.info/registered.txt +0 -122
  260. data/test/testcases/responses/whois.nic.fr/MULTIPLE.txt +0 -4
  261. data/test/whois_test.rb +0 -32
  262. data/utils/tlds.txt +0 -318
@@ -22,8 +22,8 @@ class AnswerParserWhoisNicAsiaTest < Whois::Answer::Parser::TestCase
22
22
  end
23
23
 
24
24
  def test_registered?
25
- assert !@klass.new(load_part('/available.txt')).registered?
26
25
  assert @klass.new(load_part('/registered.txt')).registered?
26
+ assert !@klass.new(load_part('/available.txt')).registered?
27
27
  end
28
28
 
29
29
 
@@ -0,0 +1,122 @@
1
+ require 'test_helper'
2
+ require 'whois/answer/parser/whois.nic.cc'
3
+
4
+ class AnswerParserWhoisNicCcTest < Whois::Answer::Parser::TestCase
5
+
6
+ def setup
7
+ @klass = Whois::Answer::Parser::WhoisNicCc
8
+ @host = "whois.nic.cc"
9
+ end
10
+
11
+
12
+ def test_disclaimer
13
+ expected = <<-EOS.strip
14
+ TERMS OF USE: You are not authorized to access or query our Whois \
15
+ database through the use of electronic processes that are high-volume and \
16
+ automated except as reasonably necessary to register domain names or \
17
+ modify existing registrations; the Data in VeriSign's ("VeriSign") Whois \
18
+ database is provided by VeriSign for information purposes only, and to \
19
+ assist persons in obtaining information about or related to a domain name \
20
+ registration record. VeriSign does not guarantee its accuracy. \
21
+ By submitting a Whois query, you agree to abide by the following terms of \
22
+ use: You agree that you may use this Data only for lawful purposes and that \
23
+ under no circumstances will you use this Data to: (1) allow, enable, or \
24
+ otherwise support the transmission of mass unsolicited, commercial \
25
+ advertising or solicitations via e-mail, telephone, or facsimile; or \
26
+ (2) enable high volume, automated, electronic processes that apply to \
27
+ VeriSign (or its computer systems). The compilation, repackaging, \
28
+ dissemination or other use of this Data is expressly prohibited without \
29
+ the prior written consent of VeriSign. You agree not to use electronic \
30
+ processes that are automated and high-volume to access or query the \
31
+ Whois database except as reasonably necessary to register domain names \
32
+ or modify existing registrations. VeriSign reserves the right to restrict \
33
+ your access to the Whois database in its sole discretion to ensure \
34
+ operational stability. VeriSign may restrict or terminate your access to the \
35
+ Whois database for failure to abide by these terms of use. VeriSign \
36
+ reserves the right to modify these terms at any time.
37
+ EOS
38
+ assert_equal expected,
39
+ @klass.new(load_part('/registered.txt')).disclaimer
40
+ assert_equal expected,
41
+ @klass.new(load_part('/available.txt')).disclaimer
42
+ end
43
+
44
+
45
+ def test_domain
46
+ assert_equal "google.cc",
47
+ @klass.new(load_part('/registered.txt')).domain
48
+ assert_equal "u34jedzcq.cc",
49
+ @klass.new(load_part('/available.txt')).domain
50
+ end
51
+
52
+ def test_domain_id
53
+ assert_equal nil,
54
+ @klass.new(load_part('/registered.txt')).domain_id
55
+ assert_equal nil,
56
+ @klass.new(load_part('/available.txt')).domain_id
57
+ end
58
+
59
+
60
+ def test_referral_whois
61
+ assert_equal "whois.markmonitor.com",
62
+ @klass.new(load_part('/registered.txt')).referral_whois
63
+ assert_equal nil,
64
+ @klass.new(load_part('/available.txt')).referral_whois
65
+ end
66
+
67
+ def test_referral_url
68
+ assert_equal "http://www.markmonitor.com",
69
+ @klass.new(load_part('/registered.txt')).referral_url
70
+ assert_equal nil,
71
+ @klass.new(load_part('/available.txt')).referral_url
72
+ end
73
+
74
+
75
+ def test_status
76
+ assert_equal ["CLIENT-XFER-PROHIBITED", "CLIENT-UPDATE-PROHIBITED", "CLIENT-DELETE-PROHIBITED"],
77
+ @klass.new(load_part('/registered.txt')).status
78
+ assert_equal nil,
79
+ @klass.new(load_part('/available.txt')).status
80
+ end
81
+
82
+ def test_available?
83
+ assert !@klass.new(load_part('/registered.txt')).available?
84
+ assert @klass.new(load_part('/available.txt')).available?
85
+ end
86
+
87
+ def test_registered?
88
+ assert @klass.new(load_part('/registered.txt')).registered?
89
+ assert !@klass.new(load_part('/available.txt')).registered?
90
+ end
91
+
92
+
93
+ def test_created_on
94
+ assert_equal Time.parse("1999-06-07"),
95
+ @klass.new(load_part('/registered.txt')).created_on
96
+ assert_equal nil,
97
+ @klass.new(load_part('/available.txt')).created_on
98
+ end
99
+
100
+ def test_updated_on
101
+ assert_equal Time.parse("2009-05-06"),
102
+ @klass.new(load_part('/registered.txt')).updated_on
103
+ assert_equal nil,
104
+ @klass.new(load_part('/available.txt')).updated_on
105
+ end
106
+
107
+ def test_expires_on
108
+ assert_equal Time.parse("2010-06-07"),
109
+ @klass.new(load_part('/registered.txt')).expires_on
110
+ assert_equal nil,
111
+ @klass.new(load_part('/available.txt')).expires_on
112
+ end
113
+
114
+
115
+ def test_registrar
116
+ assert_equal nil,
117
+ @klass.new(load_part('/registered.txt')).registrar
118
+ assert_equal nil,
119
+ @klass.new(load_part('/available.txt')).registrar
120
+ end
121
+
122
+ end
@@ -0,0 +1,49 @@
1
+ require 'test_helper'
2
+ require 'whois/answer/parser/whois.nic.cd.rb'
3
+
4
+ class AnswerParserWhoisNicCdTest < Whois::Answer::Parser::TestCase
5
+
6
+ def setup
7
+ @klass = Whois::Answer::Parser::WhoisNicCd
8
+ @host = "whois.nic.cd"
9
+ end
10
+
11
+
12
+ def test_status
13
+ assert_equal ["CLIENT TRANSFER PROHIBITED", "CLIENT DELETE PROHIBITED"],
14
+ @klass.new(load_part('/registered.txt')).status
15
+ assert_equal [],
16
+ @klass.new(load_part('/available.txt')).status
17
+ end
18
+
19
+ def test_available?
20
+ assert !@klass.new(load_part('/registered.txt')).available?
21
+ assert @klass.new(load_part('/available.txt')).available?
22
+ end
23
+
24
+ def test_registered?
25
+ assert @klass.new(load_part('/registered.txt')).registered?
26
+ assert !@klass.new(load_part('/available.txt')).registered?
27
+ end
28
+
29
+
30
+ def test_created_on
31
+ assert_equal Time.parse("2006-09-30 22:26:42"),
32
+ @klass.new(load_part('/registered.txt')).created_on
33
+ assert_equal nil,
34
+ @klass.new(load_part('/available.txt')).created_on
35
+ end
36
+
37
+ def test_updated_on
38
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).updated_on }
39
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).updated_on }
40
+ end
41
+
42
+ def test_expires_on
43
+ assert_equal Time.parse("2010-10-01 00:00:00"),
44
+ @klass.new(load_part('/registered.txt')).expires_on
45
+ assert_equal nil,
46
+ @klass.new(load_part('/available.txt')).expires_on
47
+ end
48
+
49
+ end
@@ -0,0 +1,45 @@
1
+ require 'test_helper'
2
+ require 'whois/answer/parser/whois.nic.ch.rb'
3
+
4
+ class AnswerParserWhoisNicChTest < Whois::Answer::Parser::TestCase
5
+
6
+ def setup
7
+ @klass = Whois::Answer::Parser::WhoisNicCh
8
+ @host = "whois.nic.ch"
9
+ end
10
+
11
+
12
+ def test_status
13
+ assert_equal :registered,
14
+ @klass.new(load_part('/registered.txt')).status
15
+ assert_equal :available,
16
+ @klass.new(load_part('/available.txt')).status
17
+ end
18
+
19
+ def test_available?
20
+ assert !@klass.new(load_part('/registered.txt')).available?
21
+ assert @klass.new(load_part('/available.txt')).available?
22
+ end
23
+
24
+ def test_registered?
25
+ assert !@klass.new(load_part('/available.txt')).registered?
26
+ assert @klass.new(load_part('/registered.txt')).registered?
27
+ end
28
+
29
+
30
+ def test_created_on
31
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).created_on }
32
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).created_on }
33
+ end
34
+
35
+ def test_updated_on
36
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).updated_on }
37
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).updated_on }
38
+ end
39
+
40
+ def test_expires_on
41
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).expires_on }
42
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).expires_on }
43
+ end
44
+
45
+ end
@@ -0,0 +1,51 @@
1
+ require 'test_helper'
2
+ require 'whois/answer/parser/whois.nic.coop.rb'
3
+
4
+ class AnswerParserWhoisNicCoopTest < Whois::Answer::Parser::TestCase
5
+
6
+ def setup
7
+ @klass = Whois::Answer::Parser::WhoisNicCoop
8
+ @host = "whois.nic.coop"
9
+ end
10
+
11
+
12
+ def test_status
13
+ assert_equal :ok,
14
+ @klass.new(load_part('/registered.txt')).status
15
+ assert_equal nil,
16
+ @klass.new(load_part('/available.txt')).status
17
+ end
18
+
19
+ def test_available?
20
+ assert !@klass.new(load_part('/registered.txt')).available?
21
+ assert @klass.new(load_part('/available.txt')).available?
22
+ end
23
+
24
+ def test_registered?
25
+ assert @klass.new(load_part('/registered.txt')).registered?
26
+ assert !@klass.new(load_part('/available.txt')).registered?
27
+ end
28
+
29
+
30
+ def test_created_on
31
+ assert_equal Time.parse("2002-01-31 22:12:44 UTC"),
32
+ @klass.new(load_part('/registered.txt')).created_on
33
+ assert_equal nil,
34
+ @klass.new(load_part('/available.txt')).created_on
35
+ end
36
+
37
+ def test_updated_on
38
+ assert_equal Time.parse("2007-01-17 23:58:04 UTC"),
39
+ @klass.new(load_part('/registered.txt')).updated_on
40
+ assert_equal nil,
41
+ @klass.new(load_part('/available.txt')).updated_on
42
+ end
43
+
44
+ def test_expires_on
45
+ assert_equal Time.parse("2012-01-31 22:12:44 UTC"),
46
+ @klass.new(load_part('/registered.txt')).expires_on
47
+ assert_equal nil,
48
+ @klass.new(load_part('/available.txt')).expires_on
49
+ end
50
+
51
+ end
@@ -8,44 +8,209 @@ class AnswerParserWhoisNicFrTest < Whois::Answer::Parser::TestCase
8
8
  @host = "whois.nic.fr"
9
9
  end
10
10
 
11
+ end
12
+
13
+ class AnswerParserWhoisNicFrFrTest < AnswerParserWhoisNicFrTest
11
14
 
12
15
  def test_status
13
16
  assert_equal :available,
14
- @klass.new(load_part('/available.txt')).status
17
+ @klass.new(load_part('/fr/available.txt')).status
15
18
  assert_equal :active,
16
- @klass.new(load_part('/registered.txt')).status
19
+ @klass.new(load_part('/fr/registered.txt')).status
17
20
  end
18
21
 
19
22
  def test_available?
20
- assert !@klass.new(load_part('/registered.txt')).available?
21
- assert @klass.new(load_part('/available.txt')).available?
23
+ assert !@klass.new(load_part('/fr/registered.txt')).available?
24
+ assert @klass.new(load_part('/fr/available.txt')).available?
22
25
  end
23
26
 
24
27
  def test_registered?
25
- assert !@klass.new(load_part('/available.txt')).registered?
26
- assert @klass.new(load_part('/registered.txt')).registered?
28
+ assert !@klass.new(load_part('/fr/available.txt')).registered?
29
+ assert @klass.new(load_part('/fr/registered.txt')).registered?
27
30
  end
28
31
 
29
32
 
30
33
  def test_created_on
31
34
  assert_equal Time.parse("2000-07-27"),
32
- @klass.new(load_part('/registered.txt')).created_on
35
+ @klass.new(load_part('/fr/registered.txt')).created_on
33
36
  assert_equal nil,
34
- @klass.new(load_part('/available.txt')).created_on
37
+ @klass.new(load_part('/fr/available.txt')).created_on
35
38
  end
36
39
 
37
40
  def test_updated_on
38
41
  assert_equal Time.parse("2009-06-03"),
39
- @klass.new(load_part('/registered.txt')).updated_on
42
+ @klass.new(load_part('/fr/registered.txt')).updated_on
43
+ assert_equal nil,
44
+ @klass.new(load_part('/fr/available.txt')).updated_on
45
+ end
46
+
47
+ def test_expires_on
48
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/fr/registered.txt')).expires_on }
49
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/fr/available.txt')).expires_on }
50
+ end
51
+
52
+ end
53
+
54
+ class AnswerParserWhoisNicFrPmTest < AnswerParserWhoisNicFrTest
55
+
56
+ def test_status
57
+ assert_equal :available,
58
+ @klass.new(load_part('/pm/available.txt')).status
59
+ assert_equal :active,
60
+ @klass.new(load_part('/pm/registered.txt')).status
61
+ end
62
+
63
+ def test_available?
64
+ assert !@klass.new(load_part('/pm/registered.txt')).available?
65
+ assert @klass.new(load_part('/pm/available.txt')).available?
66
+ end
67
+
68
+ def test_registered?
69
+ assert !@klass.new(load_part('/pm/available.txt')).registered?
70
+ assert @klass.new(load_part('/pm/registered.txt')).registered?
71
+ end
72
+
73
+
74
+ def test_created_on
75
+ assert_equal Time.parse("1995-01-01"),
76
+ @klass.new(load_part('/pm/registered.txt')).created_on
77
+ assert_equal nil,
78
+ @klass.new(load_part('/pm/available.txt')).created_on
79
+ end
80
+
81
+ def test_updated_on
82
+ assert_equal Time.parse("2004-09-17"),
83
+ @klass.new(load_part('/pm/registered.txt')).updated_on
40
84
  assert_equal nil,
41
- @klass.new(load_part('/available.txt')).updated_on
85
+ @klass.new(load_part('/pm/available.txt')).updated_on
42
86
  end
43
87
 
44
88
  def test_expires_on
89
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/pm/registered.txt')).expires_on }
90
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/pm/available.txt')).expires_on }
91
+ end
92
+
93
+ end
94
+
95
+ class AnswerParserWhoisNicFrReTest < AnswerParserWhoisNicFrTest
96
+
97
+ def test_status
98
+ assert_equal :available,
99
+ @klass.new(load_part('/re/available.txt')).status
100
+ assert_equal :active,
101
+ @klass.new(load_part('/re/registered.txt')).status
102
+ end
103
+
104
+ def test_available?
105
+ assert !@klass.new(load_part('/re/registered.txt')).available?
106
+ assert @klass.new(load_part('/re/available.txt')).available?
107
+ end
108
+
109
+ def test_registered?
110
+ assert !@klass.new(load_part('/re/available.txt')).registered?
111
+ assert @klass.new(load_part('/re/registered.txt')).registered?
112
+ end
113
+
114
+
115
+ def test_created_on
116
+ assert_equal Time.parse("1995-01-01"),
117
+ @klass.new(load_part('/re/registered.txt')).created_on
45
118
  assert_equal nil,
46
- @klass.new(load_part('/registered.txt')).expires_on
119
+ @klass.new(load_part('/re/available.txt')).created_on
120
+ end
121
+
122
+ def test_updated_on
123
+ assert_equal Time.parse("2009-03-12"),
124
+ @klass.new(load_part('/re/registered.txt')).updated_on
47
125
  assert_equal nil,
48
- @klass.new(load_part('/available.txt')).expires_on
126
+ @klass.new(load_part('/re/available.txt')).updated_on
127
+ end
128
+
129
+ def test_expires_on
130
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/re/registered.txt')).expires_on }
131
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/re/available.txt')).expires_on }
132
+ end
133
+
134
+ end
135
+
136
+ class AnswerParserWhoisNicFrWfTest < AnswerParserWhoisNicFrTest
137
+
138
+ def test_status
139
+ assert_equal :available,
140
+ @klass.new(load_part('/wf/available.txt')).status
141
+ assert_equal :active,
142
+ @klass.new(load_part('/wf/registered.txt')).status
143
+ end
144
+
145
+ def test_available?
146
+ assert !@klass.new(load_part('/wf/registered.txt')).available?
147
+ assert @klass.new(load_part('/wf/available.txt')).available?
148
+ end
149
+
150
+ def test_registered?
151
+ assert !@klass.new(load_part('/wf/available.txt')).registered?
152
+ assert @klass.new(load_part('/wf/registered.txt')).registered?
153
+ end
154
+
155
+
156
+ def test_created_on
157
+ assert_equal Time.parse("1995-01-01"),
158
+ @klass.new(load_part('/wf/registered.txt')).created_on
159
+ assert_equal nil,
160
+ @klass.new(load_part('/wf/available.txt')).created_on
161
+ end
162
+
163
+ def test_updated_on
164
+ assert_equal Time.parse("2004-09-17"),
165
+ @klass.new(load_part('/wf/registered.txt')).updated_on
166
+ assert_equal nil,
167
+ @klass.new(load_part('/wf/available.txt')).updated_on
168
+ end
169
+
170
+ def test_expires_on
171
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/wf/registered.txt')).expires_on }
172
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/wf/available.txt')).expires_on }
173
+ end
174
+
175
+ end
176
+
177
+ class AnswerParserWhoisNicFrYtTest < AnswerParserWhoisNicFrTest
178
+
179
+ def test_status
180
+ assert_equal :available,
181
+ @klass.new(load_part('/yt/available.txt')).status
182
+ assert_equal :active,
183
+ @klass.new(load_part('/yt/registered.txt')).status
184
+ end
185
+
186
+ def test_available?
187
+ assert !@klass.new(load_part('/yt/registered.txt')).available?
188
+ assert @klass.new(load_part('/yt/available.txt')).available?
189
+ end
190
+
191
+ def test_registered?
192
+ assert !@klass.new(load_part('/yt/available.txt')).registered?
193
+ assert @klass.new(load_part('/yt/registered.txt')).registered?
194
+ end
195
+
196
+
197
+ def test_created_on
198
+ assert_equal Time.parse("1995-01-01"),
199
+ @klass.new(load_part('/yt/registered.txt')).created_on
200
+ assert_equal nil,
201
+ @klass.new(load_part('/yt/available.txt')).created_on
202
+ end
203
+
204
+ def test_updated_on
205
+ assert_equal Time.parse("2004-09-17"),
206
+ @klass.new(load_part('/yt/registered.txt')).updated_on
207
+ assert_equal nil,
208
+ @klass.new(load_part('/yt/available.txt')).updated_on
209
+ end
210
+
211
+ def test_expires_on
212
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/yt/registered.txt')).expires_on }
213
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/yt/available.txt')).expires_on }
49
214
  end
50
215
 
51
- end
216
+ end