Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

Commit

Permalink
Add Knock output
Browse files Browse the repository at this point in the history
  • Loading branch information
leahneukirchen committed Nov 30, 2008
1 parent 8055e79 commit b473f20
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/bacon
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down
17 changes: 17 additions & 0 deletions lib/bacon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,23 @@ def handle_summary
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
Expand Down

0 comments on commit b473f20

Please sign in to comment.