summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2008-11-30 11:00:28 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2008-11-30 11:00:28 +0100
commitb473f201b54ebbe5c8cd1a59ee8571d74bf2a7ed (patch)
treec5925d209234b32d22db9a2c65a94c856da3dc78 /lib
parent8055e791eae194733fc31cc3687b9a30b8413515 (diff)
downloadbacon-b473f201b54ebbe5c8cd1a59ee8571d74bf2a7ed.tar.gz
bacon-b473f201b54ebbe5c8cd1a59ee8571d74bf2a7ed.tar.xz
bacon-b473f201b54ebbe5c8cd1a59ee8571d74bf2a7ed.zip
Add Knock output
Diffstat (limited to 'lib')
-rw-r--r--lib/bacon.rb17
1 files changed, 17 insertions, 0 deletions
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