Skip to content

Commit 6ec3cb3

Browse files
committed
Change error for non-existent path
1 parent b31c582 commit 6ec3cb3

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

library/socket/unixsocket/initialize_spec.rb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,17 @@
44
with_feature :unix_socket do
55
describe 'UNIXSocket#initialize' do
66
describe 'using a non existing path' do
7-
it 'raises Errno::ENOENT' do
8-
-> { UNIXSocket.new(SocketSpecs.socket_path) }.should raise_error(Errno::ENOENT)
7+
platform_is_not :windows do
8+
it 'raises Errno::ENOENT' do
9+
-> { UNIXSocket.new(SocketSpecs.socket_path) }.should raise_error(Errno::ENOENT)
10+
end
11+
end
12+
13+
platform_is :windows do
14+
# Why, Windows, why?
15+
it 'raises Errno::ECONNREFUSED' do
16+
-> { UNIXSocket.new(SocketSpecs.socket_path) }.should raise_error(Errno::ECONNREFUSED)
17+
end
918
end
1019
end
1120

library/socket/unixsocket/shared/pair.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
end
3131

3232
platform_is :windows do
33-
it "emulates abstract sockets with a temporary file with a path" do
33+
it "emulates unnamed sockets with a temporary file with a path" do
3434
@s1.path.match?(/\\AppData\\Local\\Temp\\\d+-\d+\.\(\$\)\z/).should be_true
3535
@s1.addr.should == ["AF_UNIX", @s1.path]
3636
@s2.peeraddr.should == ["AF_UNIX", @s1.path]

0 commit comments

Comments
 (0)