diff options
author | Terence Lee <hone02@gmail.com> | 2012-09-18 11:34:18 +0300 |
---|---|---|
committer | Terence Lee <hone02@gmail.com> | 2012-09-18 11:34:28 +0300 |
commit | 6e9939d1c0041e5abb35e83eadaf56135e011141 (patch) | |
tree | 891f70836cf5627723745a28616983bed714fb58 | |
parent | 31ec2665f41218f38291b31767f1f3f2b0977eb4 (diff) | |
download | bundler-6e9939d1c0041e5abb35e83eadaf56135e011141.tar.gz |
shut the server down in the test
-rw-r--r-- | spec/install/gems/dependency_api_spec.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/install/gems/dependency_api_spec.rb b/spec/install/gems/dependency_api_spec.rb index 9e99c517d7..75b5f29b65 100644 --- a/spec/install/gems/dependency_api_spec.rb +++ b/spec/install/gems/dependency_api_spec.rb @@ -171,7 +171,7 @@ describe "gemcutter's dependency API" do 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, @@ -179,11 +179,15 @@ describe "gemcutter's dependency API" do :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 |