/spec/whois/parsers/responses/whois.nic.gl/gl/status_registered_spec.rb

https://github.com/weppos/whois-parser · Ruby · 90 lines · 75 code · 5 blank · 10 comment · 0 complexity · acb31298870e081eafe3518b8efec5da 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.gl/gl/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/parsers/whois.nic.gl.rb'
  13. describe Whois::Parsers::WhoisNicGl, "status_registered.expected" do
  14. subject do
  15. file = fixture("responses", "whois.nic.gl/gl/status_registered.txt")
  16. part = Whois::Record::Part.new(body: File.read(file))
  17. described_class.new(part)
  18. end
  19. describe "#domain" do
  20. it do
  21. expect(subject.domain).to eq("google.gl")
  22. end
  23. end
  24. describe "#domain_id" do
  25. it do
  26. expect(subject.domain_id).to eq("Imp669-GL")
  27. end
  28. end
  29. describe "#status" do
  30. it do
  31. expect(subject.status).to eq(:registered)
  32. end
  33. end
  34. describe "#available?" do
  35. it do
  36. expect(subject.available?).to eq(false)
  37. end
  38. end
  39. describe "#registered?" do
  40. it do
  41. expect(subject.registered?).to eq(true)
  42. end
  43. end
  44. describe "#created_on" do
  45. it do
  46. expect(subject.created_on).to be_a(Time)
  47. expect(subject.created_on).to eq(Time.parse("2003-03-11 03:00:00 UTC"))
  48. end
  49. end
  50. describe "#updated_on" do
  51. it do
  52. expect(subject.updated_on).to be_a(Time)
  53. expect(subject.updated_on).to eq(Time.parse("2013-12-02 19:11:52 UTC"))
  54. end
  55. end
  56. describe "#expires_on" do
  57. it do
  58. expect(subject.expires_on).to be_a(Time)
  59. expect(subject.expires_on).to eq(Time.parse("2015-01-01 03:00:00 UTC"))
  60. end
  61. end
  62. describe "#registrar" do
  63. it do
  64. expect(subject.registrar).to be_a(Whois::Parser::Registrar)
  65. expect(subject.registrar.id).to eq(nil)
  66. expect(subject.registrar.name).to eq("MarkMonitor")
  67. expect(subject.registrar.organization).to eq(nil)
  68. expect(subject.registrar.url).to eq("http://www.markmonitor.com")
  69. end
  70. end
  71. describe "#nameservers" do
  72. it do
  73. expect(subject.nameservers).to be_a(Array)
  74. expect(subject.nameservers.size).to eq(2)
  75. expect(subject.nameservers[0]).to be_a(Whois::Parser::Nameserver)
  76. expect(subject.nameservers[0].name).to eq("ns1.google.com")
  77. expect(subject.nameservers[0].ipv4).to eq(nil)
  78. expect(subject.nameservers[0].ipv6).to eq(nil)
  79. expect(subject.nameservers[1]).to be_a(Whois::Parser::Nameserver)
  80. expect(subject.nameservers[1].name).to eq("ns2.google.com")
  81. expect(subject.nameservers[1].ipv4).to eq(nil)
  82. expect(subject.nameservers[1].ipv6).to eq(nil)
  83. end
  84. end
  85. end