Skip to content
This repository
Browse code

Merge pull request #163 from debreczeni/quiet_option

quiet option for spork server
  • Loading branch information...
commit 055b32fb771d6135728c25113851edb9d00cf561 2 parents 17aaa55 + e910c1c
Tim Harper authored May 04, 2012
3  lib/spork/runner.rb
@@ -22,6 +22,7 @@ def initialize(args, output, error)
22 22
       opt.on("-b", "--bootstrap")  {|ignore| @options[:bootstrap] = true }
23 23
       opt.on("-d", "--diagnose")  {|ignore| @options[:diagnose] = true }
24 24
       opt.on("-h", "--help")  {|ignore| @options[:help] = true }
  25
+      opt.on("-q", "--quiet")  {|ignore| @options[:quiet] = true }
25 26
       opt.on("-p", "--port [PORT]") {|port| @options[:port] = port }
26 27
       non_option_args = args.select { |arg| ! args[0].match(/^-/) }
27 28
       @options[:server_matcher] = non_option_args[0]
@@ -72,7 +73,7 @@ def run
72 73
       else
73 74
         run_strategy = Spork::RunStrategy.factory(test_framework)
74 75
         return(false) unless run_strategy.preload
75  
-        Spork::Server.run(:port => @options[:port] || test_framework.default_port, :run_strategy => run_strategy)
  76
+        Spork::Server.run(:port => @options[:port] || test_framework.default_port, :run_strategy => run_strategy, :quiet => @options[:quiet])
76 77
         return true
77 78
       end
78 79
     end
5  lib/spork/server.rb
@@ -14,6 +14,7 @@ class Spork::Server
14 14
   def initialize(options = {})
15 15
     @run_strategy = options[:run_strategy]
16 16
     @port = options[:port]
  17
+    @quiet = options[:quiet]
17 18
   end
18 19
   
19 20
   def self.run(options = {})
@@ -44,9 +45,9 @@ def listen
44 45
   #
45 46
   # When implementing a test server, don't override this method: override run_tests instead.
46 47
   def run(argv, stderr, stdout)
47  
-    puts "Running tests with args #{argv.inspect}..."
  48
+    puts "Running tests with args #{argv.inspect}..." unless @quiet
48 49
     result = run_strategy.run(argv, stderr, stdout)
49  
-    puts "Done.\n\n"
  50
+    puts "Done.\n\n" unless @quiet
50 51
     result
51 52
   end
52 53
   

0 notes on commit 055b32f

Please sign in to comment.
Something went wrong with that request. Please try again.