PageRenderTime 58ms CodeModel.GetById 32ms RepoModel.GetById 1ms app.codeStats 0ms

/spec/whois/record/parser/responses/whois.nic.fr/fr/property_nameservers_with_ipv4_and_some_ipv6_spec.rb

http://github.com/weppos/whois
Ruby | 54 lines | 39 code | 5 blank | 10 comment | 0 complexity | 506cb67c7b0b7aa74cacd8d5838c8eb0 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.fr/fr/property_nameservers_with_ipv4_and_some_ipv6.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, "property_nameservers_with_ipv4_and_some_ipv6.expected" do
  14. subject do
  15. file = fixture("responses", "whois.nic.fr/fr/property_nameservers_with_ipv4_and_some_ipv6.txt")
  16. part = Whois::Record::Part.new(body: File.read(file))
  17. described_class.new(part)
  18. end
  19. describe "#nameservers" do
  20. it do
  21. expect(subject.nameservers).to be_a(Array)
  22. expect(subject.nameservers).to have(6).items
  23. expect(subject.nameservers[0]).to be_a(Whois::Record::Nameserver)
  24. expect(subject.nameservers[0].name).to eq("ns1.nic.fr")
  25. expect(subject.nameservers[0].ipv4).to eq("192.134.4.1")
  26. expect(subject.nameservers[0].ipv6).to eq("2001:660:3003:2::4:1")
  27. expect(subject.nameservers[1]).to be_a(Whois::Record::Nameserver)
  28. expect(subject.nameservers[1].name).to eq("ns2.nic.fr")
  29. expect(subject.nameservers[1].ipv4).to eq("192.93.0.4")
  30. expect(subject.nameservers[1].ipv6).to eq("2001:660:3005:1::1:2")
  31. expect(subject.nameservers[2]).to be_a(Whois::Record::Nameserver)
  32. expect(subject.nameservers[2].name).to eq("ns3.nic.fr")
  33. expect(subject.nameservers[2].ipv4).to eq("192.134.0.49")
  34. expect(subject.nameservers[2].ipv6).to eq("2001:660:3006:1::1:1")
  35. expect(subject.nameservers[3]).to be_a(Whois::Record::Nameserver)
  36. expect(subject.nameservers[3].name).to eq("ns1.ext.nic.fr")
  37. expect(subject.nameservers[3].ipv4).to eq("193.51.208.13")
  38. expect(subject.nameservers[3].ipv6).to eq(nil)
  39. expect(subject.nameservers[4]).to be_a(Whois::Record::Nameserver)
  40. expect(subject.nameservers[4].name).to eq("ns4.ext.nic.fr")
  41. expect(subject.nameservers[4].ipv4).to eq("193.0.9.4")
  42. expect(subject.nameservers[4].ipv6).to eq("2001:67c:e0::4")
  43. expect(subject.nameservers[5]).to be_a(Whois::Record::Nameserver)
  44. expect(subject.nameservers[5].name).to eq("ns5.ext.nic.fr")
  45. expect(subject.nameservers[5].ipv4).to eq("206.167.244.5")
  46. expect(subject.nameservers[5].ipv6).to eq(nil)
  47. end
  48. end
  49. end