Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Commit

Permalink
close socket after test
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasb authored and halogenandtoast committed Oct 14, 2011
1 parent 25281b7 commit e442150
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions spec/browser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@
@pass = 'secret'
@url = "http://example.org/"

serv = TCPServer.new(@host, 0)
@port = serv.addr[1]
@server = TCPServer.new(@host, 0)
@port = @server.addr[1]

@proxy_requests = []
@proxy = Thread.new(serv, @proxy_requests) do |serv, proxy_requests|
@proxy = Thread.new(@server, @proxy_requests) do |serv, proxy_requests|
while conn = serv.accept do
# read request
request = []
Expand Down Expand Up @@ -141,6 +141,7 @@

after do
@proxy.kill
@server.shutdown
end

it 'uses the HTTP proxy correctly' do
Expand Down

0 comments on commit e442150

Please sign in to comment.