SuccessOrFailure

org.scalatest.TryValues.SuccessOrFailure
class SuccessOrFailure[T](theTry: Try[T], pos: Position) extends Serializable

Wrapper class that adds success and failure methods to scala.util.Try, allowing you to make statements like:

try1.success.value should be > 9
try2.failure.exception should have message "/ by zero"

Value parameters

theTry

An Try to convert to SuccessOrFailure, which provides the success and failure methods.

Attributes

Graph
Supertypes
trait Serializable
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def failure: Failure[T]

Returns the Try passed to the constructor as a Failure, if it is a Failure, else throws TestFailedException with a detail message indicating the Try was not a Failure.

Returns the Try passed to the constructor as a Failure, if it is a Failure, else throws TestFailedException with a detail message indicating the Try was not a Failure.

Attributes

def success: Success[T]

Returns the Try passed to the constructor as a Success, if it is a Success, else throws TestFailedException with a detail message indicating the Try was not a Success.

Returns the Try passed to the constructor as a Success, if it is a Success, else throws TestFailedException with a detail message indicating the Try was not a Success.

Attributes