mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
f7a4b3de1b
commit
445b04d18d
2 changed files with 14 additions and 12 deletions
|
@ -1,3 +1,8 @@
|
|||
Mon Nov 4 15:25:52 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* test/xmlrpc/webrick_testing.rb (start_server): Initialize the server
|
||||
at main thread to fail early.
|
||||
|
||||
Mon Nov 4 10:08:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* eval_intern.h (TH_EXEC_TAG, TH_JUMP_TAG): get rid of undefined
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue