Permalink
Browse files

quiet option for spork server

  • Loading branch information...
1 parent 5119287 commit e910c1cf0f22a6a42e196a36c071a97eb0a99e52 @debreczeni debreczeni committed Dec 15, 2011
Showing with 5 additions and 3 deletions.
  1. +2 −1 lib/spork/runner.rb
  2. +3 −2 lib/spork/server.rb
View
@@ -22,6 +22,7 @@ def initialize(args, output, error)
opt.on("-b", "--bootstrap") {|ignore| @options[:bootstrap] = true }
opt.on("-d", "--diagnose") {|ignore| @options[:diagnose] = true }
opt.on("-h", "--help") {|ignore| @options[:help] = true }
+ opt.on("-q", "--quiet") {|ignore| @options[:quiet] = true }
opt.on("-p", "--port [PORT]") {|port| @options[:port] = port }
non_option_args = args.select { |arg| ! args[0].match(/^-/) }
@options[:server_matcher] = non_option_args[0]
@@ -72,7 +73,7 @@ def run
else
run_strategy = Spork::RunStrategy.factory(test_framework)
return(false) unless run_strategy.preload
- Spork::Server.run(:port => @options[:port] || test_framework.default_port, :run_strategy => run_strategy)
+ Spork::Server.run(:port => @options[:port] || test_framework.default_port, :run_strategy => run_strategy, :quiet => @options[:quiet])
return true
end
end
View
@@ -14,6 +14,7 @@ class Spork::Server
def initialize(options = {})
@run_strategy = options[:run_strategy]
@port = options[:port]
+ @quiet = options[:quiet]
end
def self.run(options = {})
@@ -44,9 +45,9 @@ def listen
#
# When implementing a test server, don't override this method: override run_tests instead.
def run(argv, stderr, stdout)
- puts "Running tests with args #{argv.inspect}..."
+ puts "Running tests with args #{argv.inspect}..." unless @quiet
result = run_strategy.run(argv, stderr, stdout)
- puts "Done.\n\n"
+ puts "Done.\n\n" unless @quiet
result
end

0 comments on commit e910c1c

Please sign in to comment.