Sha256: 19a0d65591a4a8dede7f289ae86a4c25af452c762311a8af2a48db49eaf4859e

Contents?: true

Size: 820 Bytes

Versions: 10

Compression:

Stored size: 820 Bytes

Contents

require 'spec_helper'

describe Celluloid::IO::DNSResolver do
  it "resolves domain names" do
    resolver = Celluloid::IO::DNSResolver.new
    resolver.resolve("celluloid.io").should == Resolv::IPv4.create("207.97.227.245")
  end

  it "resolves CNAME responses" do
    resolver = Celluloid::IO::DNSResolver.new
    results = resolver.resolve("www.google.com")
    if results.is_a?(Array)
      results.all? {|i| i.is_a?(Resolv::IPv4) }.should be_true
    else
      results.is_a?(Resolv::IPv4).should be_true
    end
    # www.yahoo.com will be resolved randomly whether multiple or
    # single entry.
    results = resolver.resolve("www.yahoo.com")
    if results.is_a?(Array)
      results.all? {|i| i.is_a?(Resolv::IPv4) }.should be_true
    else
      results.is_a?(Resolv::IPv4).should be_true
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
celluloid-io-0.14.1 spec/celluloid/io/dns_resolver_spec.rb
celluloid-io-0.14.0 spec/celluloid/io/dns_resolver_spec.rb
celluloid-io-0.14.0.pre spec/celluloid/io/dns_resolver_spec.rb
celluloid-io-0.13.1 spec/celluloid/io/dns_resolver_spec.rb
celluloid-io-0.13.0 spec/celluloid/io/dns_resolver_spec.rb
celluloid-io-0.13.0.pre2 spec/celluloid/io/dns_resolver_spec.rb
celluloid-io-0.13.0.pre spec/celluloid/io/dns_resolver_spec.rb
celluloid-io-0.12.1 spec/celluloid/io/dns_resolver_spec.rb
celluloid-io-0.12.0 spec/celluloid/io/dns_resolver_spec.rb
celluloid-io-0.11.0 spec/celluloid/io/dns_resolver_spec.rb