All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.specs2.runner.NotifierRunner.scala Maven / Gradle / Ivy

There is a newer version: 3.7
Show newest version
package org.specs2
package runner

import reporter._
import main.Arguments
import specification.{ExecutedSpecification, ExecutingSpecification}

/**
 * This runner can be used with any class implementing the Notifier trait
 */
case class NotifierRunner(notifier: Notifier) { outer =>

  def classRunner = new ClassRunner {
    override lazy val reporter: Reporter = new NotifierReporter {
      val notifier = outer.notifier
      override def export(implicit arguments: Arguments): ExecutingSpecification => ExecutedSpecification = (spec: ExecutingSpecification) => {
        super.export(arguments)(spec)
        exportAll(arguments)(spec)
        spec.executed
      }
    }
  }

  def main(arguments: Array[String])  = classRunner.main(Array(arguments:_*))
  def start(arguments: Array[String]) = classRunner.start(arguments:_*)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy