2011-12-30 15:47:08 +00:00
|
|
|
#= require jasmine.HeadlessReporter.js
|
|
|
|
|
|
|
|
class jasmine.HeadlessReporter.Tap extends jasmine.HeadlessReporter
|
2011-12-29 23:37:23 +00:00
|
|
|
constructor: (@outputTarget = null) ->
|
|
|
|
super(@outputTarget)
|
|
|
|
|
|
|
|
@output = []
|
|
|
|
|
|
|
|
reportRunnerResults: (runner) ->
|
|
|
|
super(runner)
|
|
|
|
|
|
|
|
@output.unshift("1..#{@output.length}") if @output.length > 0
|
|
|
|
|
|
|
|
this.puts(@output.join("\n"))
|
|
|
|
|
|
|
|
reportSpecResults: (spec) ->
|
|
|
|
super(spec)
|
|
|
|
|
|
|
|
index = @output.length + 1
|
|
|
|
description = spec.getSpecSplitName().join(' ')
|
|
|
|
|
|
|
|
this._reportSpecResult(spec, {
|
|
|
|
success: (results) =>
|
|
|
|
@output.push("ok #{index} #{description}")
|
|
|
|
failure: (results) =>
|
|
|
|
@output.push("not ok #{index} #{description}")
|
|
|
|
})
|
|
|
|
|