/spec/whois/record/parser/responses/whois.nic.cz/property_nameservers_with_ip_spec.rb
Ruby | 40 lines | 25 code | 5 blank | 10 comment | 0 complexity | 4e2546d4978d07a3814d817131f69375 MD5 | raw file
Possible License(s): MIT
- # encoding: utf-8
- # This file is autogenerated. Do not edit it manually.
- # If you want change the content of this file, edit
- #
- # /spec/fixtures/responses/whois.nic.cz/property_nameservers_with_ip.expected
- #
- # and regenerate the tests with the following rake task
- #
- # $ rake spec:generate
- #
- require 'spec_helper'
- require 'whois/record/parser/whois.nic.cz.rb'
- describe Whois::Record::Parser::WhoisNicCz, "property_nameservers_with_ip.expected" do
- subject do
- file = fixture("responses", "whois.nic.cz/property_nameservers_with_ip.txt")
- part = Whois::Record::Part.new(body: File.read(file))
- described_class.new(part)
- end
- describe "#nameservers" do
- it do
- expect(subject.nameservers).to be_a(Array)
- expect(subject.nameservers).to have(3).items
- expect(subject.nameservers[0]).to be_a(Whois::Record::Nameserver)
- expect(subject.nameservers[0].name).to eq("ns.kraxnet.com")
- expect(subject.nameservers[0].ipv4).to eq(nil)
- expect(subject.nameservers[1]).to be_a(Whois::Record::Nameserver)
- expect(subject.nameservers[1].name).to eq("ns1.kraxnet.cz")
- expect(subject.nameservers[1].ipv4).to eq("178.217.247.1")
- expect(subject.nameservers[2]).to be_a(Whois::Record::Nameserver)
- expect(subject.nameservers[2].name).to eq("ns.kraxnet.cz")
- expect(subject.nameservers[2].ipv4).to eq("178.217.247.2")
- expect(subject.nameservers[2].ipv6).to eq("2a02:1360::56")
- end
- end
- end