PageRenderTime 53ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 0ms

/spec/whois/record/parser/responses/whois.nic.uk/status_reserved_spec.rb

http://github.com/weppos/whois
Ruby | 114 lines | 99 code | 5 blank | 10 comment | 0 complexity | 481bee66b7e1c4b32058f9caa0f672d3 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.nic.uk/status_reserved.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.uk.rb'
  13. describe Whois::Record::Parser::WhoisNicUk, "status_reserved.expected" do
  14. subject do
  15. file = fixture("responses", "whois.nic.uk/status_reserved.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. expect(subject.status).to eq(:reserved)
  22. end
  23. end
  24. describe "#available?" do
  25. it do
  26. expect(subject.available?).to eq(false)
  27. end
  28. end
  29. describe "#registered?" do
  30. it do
  31. expect(subject.registered?).to eq(true)
  32. end
  33. end
  34. describe "#created_on" do
  35. it do
  36. expect(subject.created_on).to be_a(Time)
  37. expect(subject.created_on).to eq(Time.parse("1996-08-01"))
  38. end
  39. end
  40. describe "#updated_on" do
  41. it do
  42. expect(subject.updated_on).to be_a(Time)
  43. expect(subject.updated_on).to eq(Time.parse("2012-03-23"))
  44. end
  45. end
  46. describe "#expires_on" do
  47. it do
  48. expect(subject.expires_on).to eq(nil)
  49. end
  50. end
  51. describe "#registrar" do
  52. it do
  53. expect(subject.registrar).to be_a(Whois::Record::Registrar)
  54. expect(subject.registrar.id).to eq(nil)
  55. expect(subject.registrar.name).to eq("Nominet")
  56. expect(subject.registrar.organization).to eq("Nominet UK")
  57. expect(subject.registrar.url).to eq("http://www.nic.uk/")
  58. end
  59. end
  60. describe "#registrant_contacts" do
  61. it do
  62. expect(subject.registrant_contacts).to be_a(Array)
  63. expect(subject.registrant_contacts).to have(1).items
  64. expect(subject.registrant_contacts[0]).to be_a(Whois::Record::Contact)
  65. expect(subject.registrant_contacts[0].type).to eq(Whois::Record::Contact::TYPE_REGISTRANT)
  66. expect(subject.registrant_contacts[0].id).to eq(nil)
  67. expect(subject.registrant_contacts[0].name).to eq("Nominet UK")
  68. expect(subject.registrant_contacts[0].organization).to eq(nil)
  69. expect(subject.registrant_contacts[0].address).to eq("Minerva House, Edmund Halley Road\nOxford Science Park")
  70. expect(subject.registrant_contacts[0].city).to eq("Oxford")
  71. expect(subject.registrant_contacts[0].zip).to eq("OX4 4DQ")
  72. expect(subject.registrant_contacts[0].state).to eq("Oxon")
  73. expect(subject.registrant_contacts[0].country).to eq("United Kingdom")
  74. end
  75. end
  76. describe "#nameservers" do
  77. it do
  78. expect(subject.nameservers).to be_a(Array)
  79. expect(subject.nameservers).to have(3).items
  80. expect(subject.nameservers[0]).to be_a(Whois::Record::Nameserver)
  81. expect(subject.nameservers[0].name).to eq("nom-ns1.nominet.org.uk")
  82. expect(subject.nameservers[0].ipv4).to eq("213.248.199.16")
  83. expect(subject.nameservers[0].ipv6).to eq(nil)
  84. expect(subject.nameservers[1]).to be_a(Whois::Record::Nameserver)
  85. expect(subject.nameservers[1].name).to eq("nom-ns2.nominet.org.uk")
  86. expect(subject.nameservers[1].ipv4).to eq("195.66.240.250")
  87. expect(subject.nameservers[1].ipv6).to eq("2a01:40:1001:37::2")
  88. expect(subject.nameservers[2]).to be_a(Whois::Record::Nameserver)
  89. expect(subject.nameservers[2].name).to eq("nom-ns3.nominet.org.uk")
  90. expect(subject.nameservers[2].ipv4).to eq("213.219.13.194")
  91. expect(subject.nameservers[2].ipv6).to eq(nil)
  92. end
  93. end
  94. describe "#response_throttled?" do
  95. it do
  96. expect(subject.response_throttled?).to eq(false)
  97. end
  98. end
  99. describe "#valid?" do
  100. it do
  101. expect(subject.valid?).to eq(true)
  102. end
  103. end
  104. describe "#invalid?" do
  105. it do
  106. expect(subject.invalid?).to eq(false)
  107. end
  108. end
  109. end