Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
shut the server down in the test
Browse files Browse the repository at this point in the history
  • Loading branch information
hone committed Sep 18, 2012
1 parent 31ec266 commit 6e9939d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions spec/install/gems/dependency_api_spec.rb
Expand Up @@ -171,19 +171,23 @@

require File.join(File.dirname(__FILE__), '../../support/artifice/endpoint_timeout')
require 'thread'
t = Thread.new {
@t = Thread.new {
server = Rack::Server.start(:app => EndpointTimeout,
:Host => '0.0.0.0',
:Port => port,
:server => 'webrick',
:AccessLog => [])
server.start
}
t.run
@t.run

# ensure server is started
require 'timeout'
Timeout.timeout(10) { sleep(0.1) until t.status == "sleep" }
Timeout.timeout(10) { sleep(0.1) until @t.status == "sleep" }
end

after do
@t.kill
end

it "timeouts" do
Expand Down

0 comments on commit 6e9939d

Please sign in to comment.