Permalink
Browse files

Merge pull request #629 from rspec/delay-drb-loading

Delay the loading of DRB.
  • Loading branch information...
2 parents d89c87b + 3646611 commit 9a790826d538322c370bd543b11c43deb98b4bd6 @myronmarston myronmarston committed Jun 11, 2012
View
@@ -31,10 +31,8 @@ def require_rspec(path)
require_rspec 'core/configuration'
require_rspec 'core/project_initializer'
require_rspec 'core/option_parser'
-require_rspec 'core/drb_options'
require_rspec 'core/configuration_options'
require_rspec 'core/command_line'
-require_rspec 'core/drb_command_line'
require_rspec 'core/runner'
require_rspec 'core/example'
require_rspec 'core/shared_example_group'
@@ -1,3 +1,6 @@
+require 'drb/drb'
+require 'rspec/core/drb_options'
+
module RSpec
module Core
class DRbCommandLine
@@ -1,5 +1,3 @@
-require 'drb/drb'
-
module RSpec
module Core
class Runner
@@ -25,6 +23,7 @@ def self.installed_at_exit?
end
def self.running_in_drb?
+ defined?(DRb) &&
(DRb.current_server rescue false) &&
DRb.current_server.uri =~ /druby\:\/\/127.0.0.1\:/
end
@@ -59,6 +58,7 @@ def self.run(args, err=$stderr, out=$stdout)
options.parse_options
if options.options[:drb]
+ require 'rspec/core/drb_command_line'
begin
DRbCommandLine.new(options).run(err, out)
rescue DRb::DRbConnError
@@ -1,4 +1,5 @@
require "spec_helper"
+require 'rspec/core/drb_command_line'
describe "::DRbCommandLine", :type => :drb, :unless => RUBY_PLATFORM == 'java' do
let(:config) { RSpec::Core::Configuration.new }
@@ -1,4 +1,5 @@
require "spec_helper"
+require 'rspec/core/drb_options'
describe RSpec::Core::DrbOptions, :fakefs do
include ConfigOptionsHelper

0 comments on commit 9a79082

Please sign in to comment.