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

/spec/whois/record/parser/responses/whois.eu/property_nameservers_spec.rb

http://github.com/weppos/whois
Ruby | 44 lines | 29 code | 5 blank | 10 comment | 0 complexity | a5f27ddb8112c8bcb6d21a3706a1c774 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.eu/property_nameservers.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.eu.rb'
  13. describe Whois::Record::Parser::WhoisEu, "property_nameservers.expected" do
  14. subject do
  15. file = fixture("responses", "whois.eu/property_nameservers.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(5).items
  23. expect(subject.nameservers[0]).to be_a(Whois::Record::Nameserver)
  24. expect(subject.nameservers[0].name).to eq("a.nic.eu")
  25. expect(subject.nameservers[1]).to be_a(Whois::Record::Nameserver)
  26. expect(subject.nameservers[1].name).to eq("l.nic.eu")
  27. expect(subject.nameservers[2]).to be_a(Whois::Record::Nameserver)
  28. expect(subject.nameservers[2].name).to eq("p.nic.eu")
  29. expect(subject.nameservers[3]).to be_a(Whois::Record::Nameserver)
  30. expect(subject.nameservers[3].name).to eq("ns1.eurid.eu")
  31. expect(subject.nameservers[3].ipv4).to eq("91.220.191.220")
  32. expect(subject.nameservers[3].ipv6).to eq(nil)
  33. expect(subject.nameservers[4]).to be_a(Whois::Record::Nameserver)
  34. expect(subject.nameservers[4].name).to eq("ns2.eurid.eu")
  35. expect(subject.nameservers[4].ipv4).to eq("195.234.53.220")
  36. expect(subject.nameservers[4].ipv6).to eq(nil)
  37. end
  38. end
  39. end