summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2007-05-31 14:28:35 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2007-05-31 14:28:35 +0200
commitafa9a65636cdc39c7d913a359689cf972c549bee (patch)
tree5d90ea4ae0b2000655123ea10ab477ff7675a71f /bin
parentf2c89a8c06919e82b17145392a68e0cd402e6c0b (diff)
downloadbacon-afa9a65636cdc39c7d913a359689cf972c549bee.tar.gz
bacon-afa9a65636cdc39c7d913a359689cf972c549bee.tar.xz
bacon-afa9a65636cdc39c7d913a359689cf972c549bee.zip
Add Test::Unit-like output (-q)
darcs-hash:20070531122835-4fc50-fb4b446c031828f7d8e813878ec864423de9c6dc.gz
Diffstat (limited to 'bin')
-rwxr-xr-xbin/bacon13
1 files changed, 8 insertions, 5 deletions
diff --git a/bin/bacon b/bin/bacon
index 404ceb5..d898345 100755
--- a/bin/bacon
+++ b/bin/bacon
@@ -4,6 +4,7 @@
 require 'optparse'
 
 automatic = false
+output = 'SpecDoxOutput'
 
 opts = OptionParser.new("", 24, '  ') { |opts|
   opts.banner = "Usage: bacon [options] [files | -a] [-- untouched arguments]"
@@ -37,9 +38,11 @@ opts = OptionParser.new("", 24, '  ') { |opts|
   opts.separator ""
   opts.separator "bacon options:"
 
-  opts.on("-s", "--specdox", "do AgileDox-like output (default)") { }
+  opts.on("-s", "--specdox", "do AgileDox-like output (default)") {
+    output = 'SpecDoxOutput'
+  }
   opts.on("-q", "--quiet",   "do Test::Unit-like non-verbose output") {
-    # TODO
+    output = 'TestUnitOutput'
   }
 
   opts.on("-a", "--automatic", "gather tests from ./test/, include ./lib/") {
@@ -89,10 +92,10 @@ end
 
 require 'bacon'
 
+Bacon.extend Bacon.const_get(output)
+at_exit { Bacon.handle_summary }
+
 files.each { |file|
   load file
 }
 
-puts Bacon::ErrorLog
-puts Bacon.result_string
-p Bacon::Counter