Skip to content

Commit

Permalink
webrick: remove concurrent-ruby dev dependency
Browse files Browse the repository at this point in the history
Using the Queue class in stdlib is sufficient for this test,
so there's no need for a new development dependency.

And one big reason I like webrick is it's bundled with
Ruby and has no 3rd-party C ext dependencies; so having
to download and install one is a bummer.
  • Loading branch information
Eric Wong authored and tenderlove committed Jan 31, 2018
1 parent c1f1d31 commit 2618257
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
1 change: 0 additions & 1 deletion rack.gemspec
Expand Up @@ -30,6 +30,5 @@ EOF

s.add_development_dependency 'minitest', "~> 5.0"
s.add_development_dependency 'minitest-sprint'
s.add_development_dependency 'concurrent-ruby'
s.add_development_dependency 'rake'
end
13 changes: 5 additions & 8 deletions test/spec_webrick.rb
@@ -1,7 +1,6 @@
require 'minitest/autorun'
require 'rack/mock'
require 'concurrent/utility/native_integer'
require 'concurrent/atomic/count_down_latch'
require 'thread'
require File.expand_path('../testrequest', __FILE__)

Thread.abort_on_exception = true
Expand Down Expand Up @@ -120,8 +119,7 @@ def is_running?
end

it "provide a .run" do
block_ran = false
latch = Concurrent::CountDownLatch.new 1
queue = Queue.new

t = Thread.new do
Rack::Handler::WEBrick.run(lambda {},
Expand All @@ -132,13 +130,12 @@ def is_running?
:AccessLog => []}) { |server|
block_ran = true
assert_kind_of WEBrick::HTTPServer, server
@s = server
latch.count_down
queue.push(server)
}
end

latch.wait
@s.shutdown
server = queue.pop
server.shutdown
t.join
end

Expand Down

0 comments on commit 2618257

Please sign in to comment.