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

.scalaz-scalatest_2.11.0.3.0.source-code.MonkeyPatch.scala Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package org.scalatest.typelevel.patch

import org.scalatest.exceptions.{StackDepthException, StackDepthExceptionHelper}

/**
 * Some hacky patches into package private stuff I want to access from scalatest,
 * at least until I convince Bill Venners to open it up to me.
 */
object MonkeyPatch {
  def getStackDepth(stackTrace: Array[StackTraceElement], fileName: String, methodName: String, adjustment: Int = 0) = {
    StackDepthExceptionHelper.getStackDepth(stackTrace, fileName, methodName, adjustment)
  }

  def getStackDepthFun(fileName: String, methodName: String, adjustment: Int = 0) = {
    StackDepthExceptionHelper.getStackDepthFun(fileName, methodName, adjustment)
  }

  def toExceptionFunction(message: Option[String]) = {
    StackDepthException.toExceptionFunction(message)
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy