diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2008-11-30 11:00:28 +0100 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2008-11-30 11:00:28 +0100 |
commit | b473f201b54ebbe5c8cd1a59ee8571d74bf2a7ed (patch) | |
tree | c5925d209234b32d22db9a2c65a94c856da3dc78 | |
parent | 8055e791eae194733fc31cc3687b9a30b8413515 (diff) | |
download | bacon-b473f201b54ebbe5c8cd1a59ee8571d74bf2a7ed.tar.gz bacon-b473f201b54ebbe5c8cd1a59ee8571d74bf2a7ed.tar.xz bacon-b473f201b54ebbe5c8cd1a59ee8571d74bf2a7ed.zip |
Add Knock output
-rwxr-xr-x | bin/bacon | 3 | ||||
-rw-r--r-- | lib/bacon.rb | 17 |
2 files changed, 20 insertions, 0 deletions
diff --git a/bin/bacon b/bin/bacon index c76701e..104c887 100755 --- a/bin/bacon +++ b/bin/bacon @@ -49,6 +49,9 @@ opts = OptionParser.new("", 24, ' ') { |opts| opts.on("-p", "--tap", "do TAP (Test Anything Protocol) output") { output = 'TapOutput' } + opts.on("-k", "--knock", "do Knock output") { + output = 'KnockOutput' + } opts.on("-o", "--output FORMAT", "do FORMAT (SpecDox/TestUnit/Tap) output") { |format| diff --git a/lib/bacon.rb b/lib/bacon.rb index b9774f7..c1e1647 100644 --- a/lib/bacon.rb +++ b/lib/bacon.rb @@ -97,6 +97,23 @@ module Bacon end end + module KnockOutput + def handle_specification(name) yield end + + def handle_requirement(description) + ErrorLog.replace "" + error = yield + if error.empty? + puts "ok - %s" % [description] + else + puts "not ok - %s: %s" % [description, error] + puts ErrorLog.strip.gsub(/^/, '# ') if Backtraces + end + end + + def handle_summary; end + end + extend SpecDoxOutput # default class Error < RuntimeError |