]> git.openstreetmap.org Git - rails.git/blob - vendor/gems/rspec-1.1.2/lib/spec/runner/drb_command_line.rb
added RSpec and RSpec on Rails
[rails.git] / vendor / gems / rspec-1.1.2 / lib / spec / runner / drb_command_line.rb
1 require "drb/drb"
2
3 module Spec
4   module Runner
5     # Facade to run specs by connecting to a DRB server
6     class DrbCommandLine
7       # Runs specs on a DRB server. Note that this API is similar to that of
8       # CommandLine - making it possible for clients to use both interchangeably.
9       def self.run(options)
10         begin
11           DRb.start_service
12           spec_server = DRbObject.new_with_uri("druby://localhost:8989")
13           spec_server.run(options.argv, options.error_stream, options.output_stream)
14         rescue DRb::DRbConnError => e
15           options.error_stream.puts "No server is running"
16         end
17       end
18     end
19   end
20 end