Sha256: b39aa8b2c4fbc2f223a55a107890ea8d80b5351b185b64814527057404320101
Contents?: true
Size: 980 Bytes
Versions: 12
Compression:
Stored size: 980 Bytes
Contents
describe Bosh::Cloudfoundry::Validations::DnsIpMappingValidation do subject { Bosh::Cloudfoundry::Validations::DnsIpMappingValidation.new("some.domain.com", "1.2.3.4") } it "resolves valid DNS -> single IP mapping" do subject.should_receive(:resolve_dns).with("some.domain.com").and_return([true, ["1.2.3.4"]]) subject.validate subject.should be_valid subject.errors.should == [] end it "fails to resolve invalid DNS -> single IP mapping" do subject.should_receive(:resolve_dns).with("some.domain.com").and_return([false, []]) subject.validate subject.should_not be_valid subject.errors.should == ["Cannot resolve DNS 'some.domain.com' to an IP address"] end it "resolves DNS to a different IP" do subject.should_receive(:resolve_dns).with("some.domain.com").and_return([true, ["6.6.6.6"]]) subject.validate subject.should_not be_valid subject.errors.should == ["DNS 'some.domain.com' resolves to: 6.6.6.6"] end end
Version data entries
12 entries across 12 versions & 1 rubygems