PageRenderTime 54ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://github.com/doubledrones/whois
Ruby | 137 lines | 122 code | 5 blank | 10 comment | 56 complexity | 62d525616d3aa43c90b1d16ee11a2dd5 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. subject do
  15. file = fixture("responses", "whois.nic.fr/yt/status_registered.txt")
  16. part = Whois::Record::Part.new(:body => File.read(file))
  17. described_class.new(part)
  18. end
  19. describe "#status" do
  20. it do
  21. subject.status.should == :registered
  22. end
  23. end
  24. describe "#available?" do
  25. it do
  26. subject.available?.should == false
  27. end
  28. end
  29. describe "#registered?" do
  30. it do
  31. subject.registered?.should == true
  32. end
  33. end
  34. describe "#created_on" do
  35. it do
  36. subject.created_on.should be_a(Time)
  37. subject.created_on.should == Time.parse("1995-01-01")
  38. end
  39. end
  40. describe "#updated_on" do
  41. it do
  42. subject.updated_on.should be_a(Time)
  43. subject.updated_on.should == Time.parse("2004-09-17")
  44. end
  45. end
  46. describe "#expires_on" do
  47. it do
  48. lambda { subject.expires_on }.should raise_error(Whois::AttributeNotSupported)
  49. end
  50. end
  51. describe "#registrant_contacts" do
  52. it do
  53. subject.registrant_contacts.should be_a(Array)
  54. subject.registrant_contacts.should have(1).items
  55. subject.registrant_contacts[0].should be_a(Whois::Record::Contact)
  56. subject.registrant_contacts[0].type.should == Whois::Record::Contact::TYPE_REGISTRANT
  57. subject.registrant_contacts[0].id.should == "AC3598-FRNIC"
  58. subject.registrant_contacts[0].name.should == nil
  59. subject.registrant_contacts[0].organization.should == "Afnic (Mayotte - CTOM)"
  60. subject.registrant_contacts[0].address.should == "immeuble international\n2, rue Stephenson\nMontigny-Le-Bretonneux\n78181 Saint Quentin en Yvelines Cedex"
  61. subject.registrant_contacts[0].city.should == nil
  62. subject.registrant_contacts[0].zip.should == nil
  63. subject.registrant_contacts[0].state.should == nil
  64. subject.registrant_contacts[0].country.should == nil
  65. subject.registrant_contacts[0].country_code.should == "FR"
  66. subject.registrant_contacts[0].phone.should == nil
  67. subject.registrant_contacts[0].fax.should == nil
  68. subject.registrant_contacts[0].email.should == nil
  69. subject.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. subject.admin_contacts.should be_a(Array)
  75. subject.admin_contacts.should have(1).items
  76. subject.admin_contacts[0].should be_a(Whois::Record::Contact)
  77. subject.admin_contacts[0].type.should == Whois::Record::Contact::TYPE_ADMINISTRATIVE
  78. subject.admin_contacts[0].id.should == "NFC1-FRNIC"
  79. subject.admin_contacts[0].name.should == "NIC France Contact"
  80. subject.admin_contacts[0].organization.should == "AFNIC"
  81. subject.admin_contacts[0].address.should == "immeuble international\n2, rue Stephenson\nMontigny le Bretonneux\n78181 Saint Quentin en Yvelines Cedex"
  82. subject.admin_contacts[0].city.should == nil
  83. subject.admin_contacts[0].zip.should == nil
  84. subject.admin_contacts[0].state.should == nil
  85. subject.admin_contacts[0].country.should == nil
  86. subject.admin_contacts[0].country_code.should == "FR"
  87. subject.admin_contacts[0].phone.should == "+33 1 39 30 83 00"
  88. subject.admin_contacts[0].fax.should == nil
  89. subject.admin_contacts[0].email.should == "hostmaster@nic.fr"
  90. subject.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. subject.technical_contacts.should be_a(Array)
  96. subject.technical_contacts.should have(1).items
  97. subject.technical_contacts[0].should be_a(Whois::Record::Contact)
  98. subject.technical_contacts[0].type.should == Whois::Record::Contact::TYPE_TECHNICAL
  99. subject.technical_contacts[0].id.should == "NFC1-FRNIC"
  100. subject.technical_contacts[0].name.should == "NIC France Contact"
  101. subject.technical_contacts[0].organization.should == "AFNIC"
  102. subject.technical_contacts[0].address.should == "immeuble international\n2, rue Stephenson\nMontigny le Bretonneux\n78181 Saint Quentin en Yvelines Cedex"
  103. subject.technical_contacts[0].city.should == nil
  104. subject.technical_contacts[0].zip.should == nil
  105. subject.technical_contacts[0].state.should == nil
  106. subject.technical_contacts[0].country.should == nil
  107. subject.technical_contacts[0].country_code.should == "FR"
  108. subject.technical_contacts[0].phone.should == "+33 1 39 30 83 00"
  109. subject.technical_contacts[0].fax.should == nil
  110. subject.technical_contacts[0].email.should == "hostmaster@nic.fr"
  111. subject.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. subject.nameservers.should be_a(Array)
  117. subject.nameservers.should have(3).items
  118. subject.nameservers[0].should be_a(Whois::Record::Nameserver)
  119. subject.nameservers[0].name.should == "ns1.nic.fr"
  120. subject.nameservers[0].ipv4.should == "192.93.0.1"
  121. subject.nameservers[0].ipv6.should == "2001:660:3005:1::1:1"
  122. subject.nameservers[1].should be_a(Whois::Record::Nameserver)
  123. subject.nameservers[1].name.should == "ns2.nic.fr"
  124. subject.nameservers[1].ipv4.should == "192.93.0.4"
  125. subject.nameservers[1].ipv6.should == "2001:660:3005:1::1:2"
  126. subject.nameservers[2].should be_a(Whois::Record::Nameserver)
  127. subject.nameservers[2].name.should == "ns3.nic.fr"
  128. subject.nameservers[2].ipv4.should == "192.134.0.49"
  129. subject.nameservers[2].ipv6.should == "2001:660:3006:1::1:1"
  130. end
  131. end
  132. end