Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

quiet option for spork server #163

Merged
merged 1 commit into from

5 participants

@debreczeni

This adds a very simple quiet option for launching spork server to omit the "Running tests with args #{argv.inspect}..." and "Done.\n\n"

at the command line:

    spork --quiet
    spork -q

Mostly useful with guard-spork to help having better output in the terminal
Here's the related pull request that allows a quiet option to be specified on guard-spork:
guard/guard-spork#58

@arronmabrey

Hey guys any chance of pulling this in?

@mikesmullin

+1 for this. very annoying without it
http://i.imgur.com/MnQl0.png

@thibaudgg

@debreczeni maybe it would be merged quicker if you add some specs :)

@timcharper
Owner

Yes, a simple test somewhere would be helpful, but sounds like there is a lot of pain here, and this one slipped past my radar. I'll go ahead and merge it.

(you know you could use grep -v to filter output, right?)

@timcharper timcharper merged commit 055b32f into sporkrb:master
@thibaudgg

Great, thanks for merge! (sorry I didn't know for grep -v, shame on me!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 15, 2011
  1. @debreczeni
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 3 deletions.
  1. +2 −1  lib/spork/runner.rb
  2. +3 −2 lib/spork/server.rb
View
3  lib/spork/runner.rb
@@ -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
5 lib/spork/server.rb
@@ -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
Something went wrong with that request. Please try again.