Object/Trait

org.scalatest

OutcomeOf

Related Docs: trait OutcomeOf | package scalatest

Permalink

object OutcomeOf extends OutcomeOf

Companion object that facilitates the importing of OutcomeOf's method as an alternative to mixing it in. One use case is to import OutcomeOf's method so you can use it in the Scala interpreter.

Source
OutcomeOf.scala
Linear Supertypes
OutcomeOf, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. OutcomeOf
  2. OutcomeOf
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. def outcomeOf(f: ⇒ Unit): Outcome

    Permalink

    Executes the supplied code (a by-name parameter) and returns an Outcome.

    Executes the supplied code (a by-name parameter) and returns an Outcome.

    Because Errors are used to denote serious errors, ScalaTest does not always treat a test that completes abruptly with an Error as a test failure, but sometimes as an indication that serious problems have arisen that should cause the run to abort, and the outcomeOf method exhibits the same behavior. For example, if a test completes abruptly with an OutOfMemoryError, it will not be reported as a test failure, but will instead cause the run to abort. Because not everyone uses Errors only to represent serious problems, however, ScalaTest only behaves this way for the following exception types (and their subclasses):

    • java.lang.annotation.AnnotationFormatError
    • java.awt.AWTError
    • java.nio.charset.CoderMalfunctionError
    • javax.xml.parsers.FactoryConfigurationError
    • java.lang.LinkageError
    • java.lang.ThreadDeath
    • javax.xml.transform.TransformerFactoryConfigurationError
    • java.lang.VirtualMachineError

    The previous list includes all Errors that exist as part of Java 1.5 API, excluding java.lang.AssertionError. If the code supplied to outcomeOf completes abruptly in one of the errors in the previous list, outcomeOf will not return an Outcome, but rather will complete abruptly with the same exception. will wrap any other exception thrown by the supplied code in a Some and return it.

    The outcomeOf method (and ScalaTest in general) does treat a thrown AssertionError as an indication of a test failure and therefore returns a Failed wrapping the AssertionError. In addition, any other Error that is not an instance of a type mentioned in the previous list will be caught by the outcomeOf and transformed as follows:

    If the code block completes normally (i.e., it doesn't throw any exception), outcomeOf results in Succeeded.

    f

    a block of code to execute

    returns

    an Outcome representing the outcome of executing the block of code

    Definition Classes
    OutcomeOf
  16. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  17. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from OutcomeOf

Inherited from AnyRef

Inherited from Any

Ungrouped