PageRenderTime 39ms CodeModel.GetById 15ms RepoModel.GetById 1ms app.codeStats 0ms

/spec/whois/record/parser/responses/whois.nic.fr/yt/status_registered_spec.rb

https://github.com/priithaamer/whois
Ruby | 137 lines | 122 code | 5 blank | 10 comment | 56 complexity | 6cf889963b92888711d96f1e56506ff9 MD5 | raw file
  1. # encoding: utf-8
  2. # This file is autogenerated. Do not edit it manually.
  3. # If you want change the content of this file, edit
  4. #
  5. # /spec/fixtures/responses/whois.nic.fr/yt/status_registered.expected
  6. #
  7. # and regenerate the tests with the following rake task
  8. #
  9. # $ rake spec:generate
  10. #
  11. require 'spec_helper'
  12. require 'whois/record/parser/whois.nic.fr.rb'
  13. describe Whois::Record::Parser::WhoisNicFr, "status_registered.expected" do
  14. before(:each) do
  15. file = fixture("responses", "whois.nic.fr/yt/status_registered.txt")
  16. part = Whois::Record::Part.new(:body => File.read(file))
  17. @parser = klass.new(part)
  18. end
  19. describe "#status" do
  20. it do
  21. @parser.status.should == :registered
  22. end
  23. end
  24. describe "#available?" do
  25. it do
  26. @parser.available?.should == false
  27. end
  28. end
  29. describe "#registered?" do
  30. it do
  31. @parser.registered?.should == true
  32. end
  33. end
  34. describe "#created_on" do
  35. it do
  36. @parser.created_on.should be_a(Time)
  37. @parser.created_on.should == Time.parse("1995-01-01")
  38. end
  39. end
  40. describe "#updated_on" do
  41. it do
  42. @parser.updated_on.should be_a(Time)
  43. @parser.updated_on.should == Time.parse("2004-09-17")
  44. end
  45. end
  46. describe "#expires_on" do
  47. it do
  48. lambda { @parser.expires_on }.should raise_error(Whois::PropertyNotSupported)
  49. end
  50. end
  51. describe "#registrant_contacts" do
  52. it do
  53. @parser.registrant_contacts.should be_a(Array)
  54. @parser.registrant_contacts.should have(1).items
  55. @parser.registrant_contacts[0].should be_a(Whois::Record::Contact)
  56. @parser.registrant_contacts[0].type.should == Whois::Record::Contact::TYPE_REGISTRANT
  57. @parser.registrant_contacts[0].id.should == "AC3598-FRNIC"
  58. @parser.registrant_contacts[0].name.should == nil
  59. @parser.registrant_contacts[0].organization.should == "Afnic (Mayotte - CTOM)"
  60. @parser.registrant_contacts[0].address.should == "immeuble international\n2, rue Stephenson\nMontigny-Le-Bretonneux\n78181 Saint Quentin en Yvelines Cedex"
  61. @parser.registrant_contacts[0].city.should == nil
  62. @parser.registrant_contacts[0].zip.should == nil
  63. @parser.registrant_contacts[0].state.should == nil
  64. @parser.registrant_contacts[0].country.should == nil
  65. @parser.registrant_contacts[0].country_code.should == "FR"
  66. @parser.registrant_contacts[0].phone.should == nil
  67. @parser.registrant_contacts[0].fax.should == nil
  68. @parser.registrant_contacts[0].email.should == nil
  69. @parser.registrant_contacts[0].updated_on.should == Time.parse("2008-10-09 00:00:00 UTC")
  70. end
  71. end
  72. describe "#admin_contacts" do
  73. it do
  74. @parser.admin_contacts.should be_a(Array)
  75. @parser.admin_contacts.should have(1).items
  76. @parser.admin_contacts[0].should be_a(Whois::Record::Contact)
  77. @parser.admin_contacts[0].type.should == Whois::Record::Contact::TYPE_ADMIN
  78. @parser.admin_contacts[0].id.should == "NFC1-FRNIC"
  79. @parser.admin_contacts[0].name.should == "NIC France Contact"
  80. @parser.admin_contacts[0].organization.should == "AFNIC"
  81. @parser.admin_contacts[0].address.should == "immeuble international\n2, rue Stephenson\nMontigny le Bretonneux\n78181 Saint Quentin en Yvelines Cedex"
  82. @parser.admin_contacts[0].city.should == nil
  83. @parser.admin_contacts[0].zip.should == nil
  84. @parser.admin_contacts[0].state.should == nil
  85. @parser.admin_contacts[0].country.should == nil
  86. @parser.admin_contacts[0].country_code.should == "FR"
  87. @parser.admin_contacts[0].phone.should == "+33 1 39 30 83 00"
  88. @parser.admin_contacts[0].fax.should == nil
  89. @parser.admin_contacts[0].email.should == "hostmaster@nic.fr"
  90. @parser.admin_contacts[0].updated_on.should == Time.parse("2005-08-23 00:00:00 UTC")
  91. end
  92. end
  93. describe "#technical_contacts" do
  94. it do
  95. @parser.technical_contacts.should be_a(Array)
  96. @parser.technical_contacts.should have(1).items
  97. @parser.technical_contacts[0].should be_a(Whois::Record::Contact)
  98. @parser.technical_contacts[0].type.should == Whois::Record::Contact::TYPE_TECHNICAL
  99. @parser.technical_contacts[0].id.should == "NFC1-FRNIC"
  100. @parser.technical_contacts[0].name.should == "NIC France Contact"
  101. @parser.technical_contacts[0].organization.should == "AFNIC"
  102. @parser.technical_contacts[0].address.should == "immeuble international\n2, rue Stephenson\nMontigny le Bretonneux\n78181 Saint Quentin en Yvelines Cedex"
  103. @parser.technical_contacts[0].city.should == nil
  104. @parser.technical_contacts[0].zip.should == nil
  105. @parser.technical_contacts[0].state.should == nil
  106. @parser.technical_contacts[0].country.should == nil
  107. @parser.technical_contacts[0].country_code.should == "FR"
  108. @parser.technical_contacts[0].phone.should == "+33 1 39 30 83 00"
  109. @parser.technical_contacts[0].fax.should == nil
  110. @parser.technical_contacts[0].email.should == "hostmaster@nic.fr"
  111. @parser.technical_contacts[0].updated_on.should == Time.parse("2005-08-23 00:00:00 UTC")
  112. end
  113. end
  114. describe "#nameservers" do
  115. it do
  116. @parser.nameservers.should be_a(Array)
  117. @parser.nameservers.should have(3).items
  118. @parser.nameservers[0].should be_a(Whois::Record::Nameserver)
  119. @parser.nameservers[0].name.should == "ns1.nic.fr"
  120. @parser.nameservers[0].ipv4.should == "192.93.0.1"
  121. @parser.nameservers[0].ipv6.should == "2001:660:3005:1::1:1"
  122. @parser.nameservers[1].should be_a(Whois::Record::Nameserver)
  123. @parser.nameservers[1].name.should == "ns2.nic.fr"
  124. @parser.nameservers[1].ipv4.should == "192.93.0.4"
  125. @parser.nameservers[1].ipv6.should == "2001:660:3005:1::1:2"
  126. @parser.nameservers[2].should be_a(Whois::Record::Nameserver)
  127. @parser.nameservers[2].name.should == "ns3.nic.fr"
  128. @parser.nameservers[2].ipv4.should == "192.134.0.49"
  129. @parser.nameservers[2].ipv6.should == "2001:660:3006:1::1:1"
  130. end
  131. end
  132. end