blob: 6105d905d69ecfca8139c66f5ffea4e0b28d22fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
require_relative '../../../spec_helper'
require_relative '../fixtures/classes'
require 'socket'
describe "Addrinfo#canonname" do
before :each do
@addrinfos = Addrinfo.getaddrinfo("localhost", 80, :INET, :STREAM, nil, Socket::AI_CANONNAME)
end
it "returns the canonical name for a host" do
canonname = @addrinfos.map { |a| a.canonname }.find { |name| name and name.include?("localhost") }
if canonname
canonname.should include("localhost")
else
canonname.should == nil
end
end
end
|