Skip to content

Commit 5d3da03

Browse files
committed
Time out test case when reading from a pipe blocks indefinitely
1 parent 210585e commit 5d3da03

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

spec/integration/ssl_ber_spec.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
require 'spec_helper'
22

33
require 'net/ldap'
4+
require 'timeout'
45

56
describe "BER serialisation (SSL)" do
67
# Transmits str to #to and reads it back from #from.
78
#
89
def transmit(str)
9-
to.write(str)
10-
to.close
11-
12-
from.read
10+
Timeout::timeout(1) do
11+
to.write(str)
12+
to.close
13+
14+
from.read
15+
end
1316
end
1417

1518
attr_reader :to, :from

0 commit comments

Comments
 (0)