Created
December 16, 2014 15:10
-
-
Save edgarmueller/4a230e213385c061a010 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 mytest | |
import org.specs2.execute.Details | |
import org.specs2.mutable._ | |
import org.specs2.reporter.Notifier | |
class MyNotifier extends Notifier { | |
override def exampleFailure(name: String, message: String, | |
location: String, f: Throwable, details: Details, duration: Long) = { | |
println("Test failed") | |
} | |
/* other methods of Notifier follow here */ | |
override def specStart(title: String, location: String): Unit = { | |
println("Spec started") | |
} | |
override def exampleStarted(name: String, location: String): Unit = () | |
override def text(text: String, location: String): Unit = () | |
override def contextEnd(text: String, location: String): Unit = () | |
override def examplePending(name: String, message: String, duration: Long): Unit = () | |
override def exampleSuccess(name: String, duration: Long): Unit = () | |
override def exampleError(name: String, message: String, location: String, f: Throwable, duration: Long): Unit = () | |
override def specEnd(title: String, location: String): Unit = { | |
println("Spec ended") | |
} | |
override def contextStart(text: String, location: String): Unit = () | |
override def exampleSkipped(name: String, message: String, duration: Long): Unit = () | |
} | |
class HelloWorldSpec extends Specification { | |
args.report(notifier = "mytest.MyNotifier") | |
"The 'Hello world' string" should { | |
"contain 11 characters" in { | |
"Hello world" must have size(10) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment