Skip to content

Commit

Permalink
Merge pull request #163 from debreczeni/quiet_option
Browse files Browse the repository at this point in the history
quiet option for spork server
  • Loading branch information
timcharper committed May 4, 2012
2 parents 17aaa55 + e910c1c commit 055b32f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/spork/runner.rb
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions lib/spork/server.rb
Expand Up @@ -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 = {})
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 055b32f

Please sign in to comment.