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

org.specs2.reporter.ShowDescription.scala Maven / Gradle / Ivy

There is a newer version: 4.10.6
Show newest version
package org.specs2
package reporter

import org.junit.runner.Description

import scala.collection.JavaConversions._
import scalaz.Tree._
import scalaz.{Show, Tree}

/**
 * Implementation of the Show trait to allow the drawing of Tree[Description] with scalaz
 */
trait ShowDescription {

  implicit object show extends Show[Description] {
    override def show(d: Description) = d.getDisplayName
  }

  implicit def toTree(desc: Description): Tree[Description] =
    unfoldTree(desc)((d: Description) => (d, () => d.getChildren.toStream))

}

object ShowDescription extends ShowDescription





© 2015 - 2024 Weber Informatics LLC | Privacy Policy