summaryrefslogtreecommitdiff
path: root/test/xmlrpc/webrick_testing.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-04 06:27:54 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-04 06:27:54 +0000
commit445b04d18df63708a2b0ce923f07e372e4a808db (patch)
treebaf2c79bda5fc108ce8bb3d510a7f8395f8e6700 /test/xmlrpc/webrick_testing.rb
parentf7a4b3de1bafdd7790b067a8ff79d774d1a5969f (diff)
* test/xmlrpc/webrick_testing.rb (start_server): Initialize the server
at main thread to fail early. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/xmlrpc/webrick_testing.rb')
-rw-r--r--test/xmlrpc/webrick_testing.rb21
1 files changed, 9 insertions, 12 deletions
diff --git a/test/xmlrpc/webrick_testing.rb b/test/xmlrpc/webrick_testing.rb
index c2a30039469..c72895a9d17 100644
--- a/test/xmlrpc/webrick_testing.rb
+++ b/test/xmlrpc/webrick_testing.rb
@@ -11,15 +11,16 @@ module WEBrick_Testing
raise "already started" if defined?(@__server) && @__server
@__started = false
+ @__server = WEBrick::HTTPServer.new(
+ {
+ :BindAddress => "localhost",
+ :Logger => DummyLog.new,
+ :AccessLog => [],
+ }.update(config))
+ yield @__server
+ @__started = true
+
@__server_thread = Thread.new {
- @__server = WEBrick::HTTPServer.new(
- {
- :BindAddress => "localhost",
- :Logger => DummyLog.new,
- :AccessLog => [],
- :StartCallback => proc { @__started = true }
- }.update(config))
- yield @__server
begin
@__server.start
rescue IOError => e
@@ -28,10 +29,6 @@ module WEBrick_Testing
@__started = false
end
}
-
- Timeout.timeout(5) {
- Thread.pass until @__started # wait until the server is ready
- }
end
def stop_server