Class: Spec::Runner::DrbCommandLine
- Defined in:
- lib/spec/runner/drb_command_line.rb
Overview
Facade to run specs by connecting to a DRB server
Class Method Summary collapse
-
.port(options) ⇒ Object
port to run against.
-
.run(options) ⇒ Object
Runs specs on a DRB server.
Class Method Details
.port(options) ⇒ Object
port to run against
8 9 10 |
# File 'lib/spec/runner/drb_command_line.rb', line 8 def self.port() (.drb_port || ENV["RSPEC_DRB"] || 8989).to_i end |
.run(options) ⇒ Object
Runs specs on a DRB server. Note that this API is similar to that of CommandLine - making it possible for clients to use both interchangeably.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/spec/runner/drb_command_line.rb', line 15 def self.run() begin begin; \ DRb.start_service("druby://localhost:0"); \ rescue SocketError; \ DRb.start_service("druby://:0"); \ end spec_server = DRbObject.new_with_uri("druby://127.0.0.1:#{port()}") spec_server.run(.argv, .error_stream, .output_stream) true rescue DRb::DRbConnError .error_stream.puts "No server is running" false end end |