OptionValuable

org.scalatest.OptionValues.OptionValuable
class OptionValuable[T](opt: Option[T], pos: Position)

Wrapper class that adds a value method to Option, allowing you to make statements like:

opt.value should be > 9

Value parameters

opt

An option to convert to OptionValuable, which provides the value method.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def value: T

Returns the value contained in the wrapped Option, if defined, else throws TestFailedException with a detail message indicating the option was not defined.

Returns the value contained in the wrapped Option, if defined, else throws TestFailedException with a detail message indicating the option was not defined.

Attributes