diff options
-rw-r--r-- | README | 3 | ||||
-rwxr-xr-x | bin/bacon | 3 | ||||
-rw-r--r-- | lib/bacon.rb | 9 |
3 files changed, 12 insertions, 3 deletions
diff --git a/README b/README index 664a07e..feb87b1 100644 --- a/README +++ b/README @@ -231,6 +231,9 @@ It can be found at http://opensource.thinkrelevance.com/wiki/spec_converter. * Autotest support. * Bug fixes. +* XXX, 2008: Third public release 1.1. + * Add -Q/--no-backtraces to not details about failed specifications. + == Contact diff --git a/bin/bacon b/bin/bacon index bf3af97..c76701e 100755 --- a/bin/bacon +++ b/bin/bacon @@ -54,6 +54,9 @@ opts = OptionParser.new("", 24, ' ') { |opts| "do FORMAT (SpecDox/TestUnit/Tap) output") { |format| output = format + "Output" } + opts.on("-Q", "--no-backtrace", "don't print backtraces") { + Bacon.const_set :Backtraces, false + } opts.on("-a", "--automatic", "gather tests from ./test/, include ./lib/") { $LOAD_PATH.unshift "lib" if File.directory? "lib" diff --git a/lib/bacon.rb b/lib/bacon.rb index 86b699d..b34a9f2 100644 --- a/lib/bacon.rb +++ b/lib/bacon.rb @@ -19,6 +19,8 @@ module Bacon RestrictName = // unless defined? RestrictName RestrictContext = // unless defined? RestrictContext + Backtraces = true unless defined? Backtraces + def self.summary_on_exit return if Counter[:installed_summary] > 0 at_exit { @@ -47,7 +49,7 @@ module Bacon end def handle_summary - print ErrorLog + print ErrorLog if Backtraces puts "%d specifications (%d requirements), %d failures, %d errors" % Counter.values_at(:specifications, :requirements, :failed, :errors) end @@ -66,7 +68,8 @@ module Bacon end def handle_summary - puts "", ErrorLog + puts + puts ErrorLog if Backtraces puts "%d tests, %d assertions, %d failures, %d errors" % Counter.values_at(:specifications, :requirements, :failed, :errors) end @@ -83,7 +86,7 @@ module Bacon else puts "not ok %d - %s: %s" % [Counter[:specifications], description, error] - puts ErrorLog.strip.gsub(/^/, '# ') + puts ErrorLog.strip.gsub(/^/, '# ') if Backtraces end end |