PageRenderTime 56ms CodeModel.GetById 33ms RepoModel.GetById 0ms app.codeStats 0ms

/spec/whois/record/parser/responses/whois.registry.om/status_registered_spec.rb

http://github.com/weppos/whois
Ruby | 141 lines | 126 code | 5 blank | 10 comment | 2 complexity | 08821aa4e203645d9e23d3353ef6a3f1 MD5 | raw file
Possible License(s): MIT
  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.registry.om/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.registry.om.rb'
  13. describe Whois::Record::Parser::WhoisRegistryOm, "status_registered.expected" do
  14. subject do
  15. file = fixture("responses", "whois.registry.om/status_registered.txt")
  16. part = Whois::Record::Part.new(body: File.read(file))
  17. described_class.new(part)
  18. end
  19. describe "#disclaimer" do
  20. it do
  21. expect { subject.disclaimer }.to raise_error(Whois::AttributeNotSupported)
  22. end
  23. end
  24. describe "#domain" do
  25. it do
  26. expect(subject.domain).to eq("rop.gov.om")
  27. end
  28. end
  29. describe "#domain_id" do
  30. it do
  31. expect { subject.domain_id }.to raise_error(Whois::AttributeNotSupported)
  32. end
  33. end
  34. describe "#status" do
  35. it do
  36. expect(subject.status).to eq(["ok"])
  37. end
  38. end
  39. describe "#available?" do
  40. it do
  41. expect(subject.available?).to eq(false)
  42. end
  43. end
  44. describe "#registered?" do
  45. it do
  46. expect(subject.registered?).to eq(true)
  47. end
  48. end
  49. describe "#created_on" do
  50. it do
  51. expect { subject.created_on }.to raise_error(Whois::AttributeNotSupported)
  52. end
  53. end
  54. describe "#updated_on" do
  55. it do
  56. expect { subject.updated_on }.to raise_error(Whois::AttributeNotSupported)
  57. end
  58. end
  59. describe "#expires_on" do
  60. it do
  61. expect { subject.expires_on }.to raise_error(Whois::AttributeNotSupported)
  62. end
  63. end
  64. describe "#registrar" do
  65. it do
  66. expect(subject.registrar).to be_a(Whois::Record::Registrar)
  67. expect(subject.registrar.id).to eq(nil)
  68. expect(subject.registrar.name).to eq("Oman Telecommunication Company")
  69. expect(subject.registrar.organization).to eq("Oman Telecommunication Company")
  70. expect(subject.registrar.url).to eq(nil)
  71. end
  72. end
  73. describe "#registrant_contacts" do
  74. it do
  75. expect(subject.registrant_contacts).to be_a(Array)
  76. expect(subject.registrant_contacts).to have(1).items
  77. expect(subject.registrant_contacts[0]).to be_a(Whois::Record::Contact)
  78. expect(subject.registrant_contacts[0].type).to eq(Whois::Record::Contact::TYPE_REGISTRANT)
  79. expect(subject.registrant_contacts[0].id).to eq("10084244")
  80. expect(subject.registrant_contacts[0].name).to eq("Nasser Said Al Daree")
  81. expect(subject.registrant_contacts[0].organization).to eq(nil)
  82. expect(subject.registrant_contacts[0].address).to eq(nil)
  83. expect(subject.registrant_contacts[0].city).to eq(nil)
  84. expect(subject.registrant_contacts[0].zip).to eq(nil)
  85. expect(subject.registrant_contacts[0].state).to eq(nil)
  86. expect(subject.registrant_contacts[0].country).to eq(nil)
  87. expect(subject.registrant_contacts[0].country_code).to eq(nil)
  88. expect(subject.registrant_contacts[0].phone).to eq(nil)
  89. expect(subject.registrant_contacts[0].fax).to eq(nil)
  90. expect(subject.registrant_contacts[0].email).to eq("Visit whois.registry.om for Web based WhoIs")
  91. end
  92. end
  93. describe "#admin_contacts" do
  94. it do
  95. expect { subject.admin_contacts }.to raise_error(Whois::AttributeNotSupported)
  96. end
  97. end
  98. describe "#technical_contacts" do
  99. it do
  100. expect(subject.technical_contacts).to be_a(Array)
  101. expect(subject.technical_contacts).to have(1).items
  102. expect(subject.technical_contacts[0]).to be_a(Whois::Record::Contact)
  103. expect(subject.technical_contacts[0].type).to eq(Whois::Record::Contact::TYPE_TECHNICAL)
  104. expect(subject.technical_contacts[0].id).to eq("10084244")
  105. expect(subject.technical_contacts[0].name).to eq("Nasser Said Al Daree")
  106. expect(subject.technical_contacts[0].organization).to eq(nil)
  107. expect(subject.technical_contacts[0].address).to eq(nil)
  108. expect(subject.technical_contacts[0].city).to eq(nil)
  109. expect(subject.technical_contacts[0].zip).to eq(nil)
  110. expect(subject.technical_contacts[0].state).to eq(nil)
  111. expect(subject.technical_contacts[0].country).to eq(nil)
  112. expect(subject.technical_contacts[0].country_code).to eq(nil)
  113. expect(subject.technical_contacts[0].phone).to eq(nil)
  114. expect(subject.technical_contacts[0].fax).to eq(nil)
  115. expect(subject.technical_contacts[0].email).to eq("Visit whois.registry.om for Web based WhoIs")
  116. end
  117. end
  118. describe "#nameservers" do
  119. it do
  120. expect(subject.nameservers).to be_a(Array)
  121. expect(subject.nameservers).to have(3).items
  122. expect(subject.nameservers[0]).to be_a(Whois::Record::Nameserver)
  123. expect(subject.nameservers[0].name).to eq("om14.omantel.net.om")
  124. expect(subject.nameservers[0].ipv4).to eq("212.72.23.4")
  125. expect(subject.nameservers[0].ipv6).to eq(nil)
  126. expect(subject.nameservers[1]).to be_a(Whois::Record::Nameserver)
  127. expect(subject.nameservers[1].name).to eq("om16.omantel.net.om")
  128. expect(subject.nameservers[1].ipv4).to eq("212.72.1.186")
  129. expect(subject.nameservers[1].ipv6).to eq(nil)
  130. expect(subject.nameservers[2]).to be_a(Whois::Record::Nameserver)
  131. expect(subject.nameservers[2].name).to eq("om41.omantel.net.om")
  132. expect(subject.nameservers[2].ipv4).to eq("62.231.243.249")
  133. expect(subject.nameservers[2].ipv6).to eq(nil)
  134. end
  135. end
  136. end