Created
July 8, 2009 16:43
-
-
Save motemen/142959 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.tokyoenvious.scalatest | |
import org.scalatest._ | |
class TAPReporter extends Reporter { | |
var testNumber : Int = 1 | |
override def runStarting (testCount : Int) = | |
println ("1.." + testCount) | |
override def testSucceeded (report : Report) = { | |
report match { | |
case specReport : SpecReport => | |
if (specReport.includeInSpecOutput) { | |
println ("ok " + testNumber + " " + specReport.formattedSpecText) | |
} | |
case _ => | |
println ("ok " + testNumber + " - " + report.name) | |
} | |
testNumber = testNumber + 1 | |
} | |
override def testFailed (report : Report) = { | |
println ("not ok " + testNumber + " - " + report.name) | |
println ("# " + report.message) | |
testNumber = testNumber + 1 | |
} | |
override def suiteStarting (report : Report) = | |
println ("# Suite " + report.name) | |
override def infoProvided(report: Report) = | |
report match { | |
case specReport : SpecReport => | |
if (specReport.includeInSpecOutput) { | |
println ("# " + specReport.formattedSpecText) | |
} | |
case _ => | |
println ("# " + report.name) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment