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

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

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

import reporter.TextReporter
import specification.Fragments
import control.Exceptions._
import main.Arguments

class TextRunner extends org.specs2.runner.ClassRunner {
  override lazy val reporter: TextReporter = new TextReporter {}

  def apply(fs: Fragments): String = {
    val specification = new Specification { def is = fs }
    tryo(reporter.report(specification)(Arguments()))(errorHandler)
    output
  }

  /** @return the output of one run */
  protected def output = {
    val result = reporter.textOutput.output
    reporter.textOutput.clear
    result
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy