Skip to content

Commit 6ecf022

Browse files
eregonandrykonchin
authored andcommitted
FreeBSD returns EAI_FAIL instead of EAI_FAMILY in getaddrinfo and getnameinfo specs
1 parent 9c18238 commit 6ecf022

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

library/socket/socket/getaddrinfo_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
-> {
121121
Socket.getaddrinfo("www.kame.net", 80, "AF_UNIX")
122122
}.should raise_error(Socket::ResolutionError) { |e|
123-
e.error_code.should == Socket::EAI_FAMILY
123+
[Socket::EAI_FAMILY, Socket::EAI_FAIL].should.include?(e.error_code)
124124
}
125125
end
126126
end

library/socket/socket/getnameinfo_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def should_be_valid_dns_name(name)
7474
-> {
7575
Socket.getnameinfo(["AF_UNIX", 80, "0.0.0.0"])
7676
}.should raise_error(Socket::ResolutionError) { |e|
77-
e.error_code.should == Socket::EAI_FAMILY
77+
[Socket::EAI_FAMILY, Socket::EAI_FAIL].should.include?(e.error_code)
7878
}
7979
end
8080
end

0 commit comments

Comments
 (0)