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

/spec/whois/record/parser/responses/whois.museum/status_registered_spec.rb

https://gitlab.com/dandrews/whois
Ruby | 71 lines | 56 code | 5 blank | 10 comment | 0 complexity | 0bebd1f082b1350b0bbe7e029098bbbb 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.museum/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.museum.rb'
  13. describe Whois::Record::Parser::WhoisMuseum, "status_registered.expected" do
  14. subject do
  15. file = fixture("responses", "whois.museum/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. expect(subject.status).to eq(:registered)
  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("2001-11-10 15:23:42 UTC"))
  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("2002-04-04 17:48:43 UTC"))
  44. end
  45. end
  46. describe "#expires_on" do
  47. it do
  48. expect(subject.expires_on).to be_a(Time)
  49. expect(subject.expires_on).to eq(Time.parse("2003-07-31 11:00:00 UTC"))
  50. end
  51. end
  52. describe "#nameservers" do
  53. it do
  54. expect(subject.nameservers).to be_a(Array)
  55. expect(subject.nameservers).to have(2).items
  56. expect(subject.nameservers[0]).to be_a(Whois::Record::Nameserver)
  57. expect(subject.nameservers[0].name).to eq("nic.museum")
  58. expect(subject.nameservers[0].ipv4).to eq("130.242.24.5")
  59. expect(subject.nameservers[0].ipv6).to eq(nil)
  60. expect(subject.nameservers[1]).to be_a(Whois::Record::Nameserver)
  61. expect(subject.nameservers[1].name).to eq("nic.frd.se")
  62. expect(subject.nameservers[1].ipv4).to eq(nil)
  63. expect(subject.nameservers[1].ipv6).to eq(nil)
  64. end
  65. end
  66. end