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

/spec/whois/record/parser/responses/whois.nic.ch/property_nameservers_with_ip_spec.rb

http://github.com/weppos/whois
Ruby | 38 lines | 23 code | 5 blank | 10 comment | 0 complexity | f6ea446d056698bc1cd7e0d14120d99c 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.ch/property_nameservers_with_ip.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.ch.rb'
  13. describe Whois::Record::Parser::WhoisNicCh, "property_nameservers_with_ip.expected" do
  14. subject do
  15. file = fixture("responses", "whois.nic.ch/property_nameservers_with_ip.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(2).items
  23. expect(subject.nameservers[0]).to be_a(Whois::Record::Nameserver)
  24. expect(subject.nameservers[0].name).to eq("ns1.citrin.ch")
  25. expect(subject.nameservers[0].ipv4).to eq("193.247.72.8")
  26. expect(subject.nameservers[0].ipv6).to eq("2001:8a8:21:5::11")
  27. expect(subject.nameservers[1]).to be_a(Whois::Record::Nameserver)
  28. expect(subject.nameservers[1].name).to eq("ns2.citrin.ch")
  29. expect(subject.nameservers[1].ipv4).to eq("62.12.149.3")
  30. expect(subject.nameservers[1].ipv6).to eq("2001:8a8:21:5::12")
  31. end
  32. end
  33. end