Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions spec/drb_default_id_conv.rb

This file was deleted.

6 changes: 3 additions & 3 deletions spec/drb_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
# See the file LICENSE.txt for details.
#++

require 'rubygems'
# Prefer gem version we already have on GEM_PATH from parent to ensure using the same version
# and avoid using outdated stdlib versions < 2.2.3
gem 'drb'
require 'drb'
require 'stringio'
require 'warbler'
Expand Down Expand Up @@ -50,8 +52,6 @@ def stop
end
end

require File.expand_path('drb_default_id_conv', File.dirname(__FILE__))

server = WarblerDrbServer.new
service = DRb.start_service 'druby://127.0.0.1:7890', server
service.thread.join
Expand Down
14 changes: 8 additions & 6 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ def capture(&block)
io.string
end

require 'drb'
require File.expand_path('drb_default_id_conv', File.dirname(__FILE__))

module ExampleGroupHelpers
def run_in_directory(dir)
before :each do
Expand Down Expand Up @@ -106,6 +103,7 @@ def create_git_gem(gem_name)

def run_out_of_process_with_drb
before :all do
require 'drb'
DRb.start_service
@orig_dir = Dir.pwd
end
Expand All @@ -114,11 +112,11 @@ def run_out_of_process_with_drb
drb
DRbObject.new(nil, 'druby://127.0.0.1:7890').tap do |drbclient|
ready, error = nil, nil
300.times do # timeout 30 secs (300 * 0.1)
600.times do # timeout 30 secs (600 * 0.05)
begin
break if ready = drbclient.ready?
rescue DRb::DRbConnError => e
error = e; sleep 0.1
error = e; sleep 0.05
end
end
raise error unless ready
Expand All @@ -129,7 +127,7 @@ def run_out_of_process_with_drb
require 'jruby'
let(:drb) do
drb_thread = Thread.new do
ruby "-I#{Warbler::WARBLER_HOME}/lib", File.join(@orig_dir, 'spec/drb_helper.rb')
ruby '--dev', "-I#{Warbler::WARBLER_HOME}/lib", File.join(@orig_dir, 'spec/drb_helper.rb')
end
drb_thread.run
drb_thread
Expand All @@ -147,6 +145,10 @@ def run_out_of_process_with_drb
drb.stop
end
end

after :all do
DRb.stop_service
end
end

def use_test_webserver
Expand Down