object Assertion
- Alphabetic
- By Inheritance
- Assertion
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
val
anything: Assertion[Any]
Makes a new assertion that always succeeds.
-
final
def
approximatelyEquals[A](reference: A, tolerance: A)(implicit arg0: Numeric[A]): Assertion[A]
Makes a new assertion that requires a given numeric value to match a value with some tolerance.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
final
def
assertion[A](name: String)(params: RenderParam*)(run: (⇒ A) ⇒ Boolean): Assertion[A]
Makes a new
Assertionfrom a pretty-printing and a function. -
final
def
assertionDirect[A](name: String)(params: RenderParam*)(run: (⇒ A) ⇒ AssertResult): Assertion[A]
Makes a new
Assertionfrom a pretty-printing and a function. -
final
def
assertionRec[A, B](name: String)(params: RenderParam*)(assertion: Assertion[B])(get: (⇒ A) ⇒ Option[B], orElse: (AssertionValue) ⇒ AssertResult = BoolAlgebra.failure): Assertion[A]
Makes a new
Assertion[A]from a pretty-printing, a function(=> A) => Option[B], and anAssertion[B].Makes a new
Assertion[A]from a pretty-printing, a function(=> A) => Option[B], and anAssertion[B]. If the result of applying the function to a given value isSome[B], theAssertion[B]will be applied to the resulting value to determine if the assertion is satisfied. The result of theAssertion[B]and any assertions it is composed from will be recursively embedded in the assert result. If the result of the function isNonetheorElseparameter will be used to determine whether the assertion is satisfied. -
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
contains[A](element: A): Assertion[Iterable[A]]
Makes a new assertion that requires an iterable contain the specified element.
-
final
def
containsCause[E](cause: Cause[E]): Assertion[Cause[E]]
Makes a new assertion that requires a
Causecontain the specified cause. -
final
def
containsString(element: String): Assertion[String]
Makes a new assertion that requires a substring to be present.
-
final
def
dies(assertion: Assertion[Throwable]): Assertion[Exit[Any, Any]]
Makes a new assertion that requires an exit value to die.
-
final
def
endsWith(suffix: String): Assertion[String]
Makes a new assertion that requires a given string to end with the specified suffix.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
equalTo(expected: Any): Assertion[Any]
Makes a new assertion that requires a value equal the specified value.
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
equalsIgnoreCase(other: String): Assertion[String]
Makes a new assertion that requires a given string to equal another ignoring case
-
final
def
exists[A](assertion: Assertion[A]): Assertion[Iterable[A]]
Makes a new assertion that requires an iterable contain one element satisfying the given assertion.
-
final
def
fails[E](assertion: Assertion[E]): Assertion[Exit[E, Any]]
Makes a new assertion that requires an exit value to fail.
-
final
def
failsCause[E](assertion: Assertion[Cause[E]]): Assertion[Exit[E, Any]]
Makes a new assertion that requires an exit value to fail with a cause that meets the specified assertion.
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
forall[A](assertion: Assertion[A]): Assertion[Iterable[A]]
Makes a new assertion that requires an iterable contain only elements satisfying the given assertion.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
hasAt[A](pos: Int)(assertion: Assertion[A]): Assertion[Seq[A]]
Makes a new assertion that requires a sequence to contain an element satisfying the given assertion on the given position
-
final
def
hasField[A, B](name: String, proj: (A) ⇒ B, assertion: Assertion[B]): Assertion[A]
Makes a new assertion that focuses in on a field in a case class.
Makes a new assertion that focuses in on a field in a case class.
hasField("age", _.age, within(0, 10))
-
final
def
hasFirst[A](assertion: Assertion[A]): Assertion[Iterable[A]]
Makes a new assertion that requires an iterable to contain the first element satisfying the given assertion
-
final
def
hasLast[A](assertion: Assertion[A]): Assertion[Iterable[A]]
Makes a new assertion that requires an iterable to contain the last element satisfying the given assertion
-
final
def
hasMessage(message: String): Assertion[Throwable]
Makes a new assertion that requires an exception to have a certain message.
-
final
def
hasSameElements[A](other: Iterable[A]): Assertion[Iterable[A]]
Makes a new assertion that requires an Iterable to have the same elements as the specified Iterable, though not necessarily in the same order
-
final
def
hasSize[A](assertion: Assertion[Int]): Assertion[Iterable[A]]
Makes a new assertion that requires the size of an iterable be satisfied by the specified assertion.
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isCase[Sum, Proj](termName: String, term: (Sum) ⇒ Option[Proj], assertion: Assertion[Proj]): Assertion[Sum]
Makes a new assertion that requires the sum type be a specified term.
Makes a new assertion that requires the sum type be a specified term.
isCase("Some", Some.unapply, anything)
-
final
val
isEmpty: Assertion[Iterable[Any]]
Makes a new assertion that requires an Iterable to be empty.
-
final
val
isEmptyString: Assertion[String]
Makes a new assertion that requires a given string to be empty.
-
final
def
isFalse: Assertion[Boolean]
Makes a new assertion that requires a value be true.
-
final
def
isGreaterThan[A](reference: A)(implicit arg0: Numeric[A]): Assertion[A]
Makes a new assertion that requires the numeric value be greater than the specified reference value.
-
final
def
isGreaterThanEqualTo[A](reference: A)(implicit arg0: Numeric[A]): Assertion[A]
Makes a new assertion that requires the numeric value be greater than or equal to the specified reference value.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
isInterrupted: Assertion[Exit[Any, Any]]
Makes a new assertion that requires an exit value to be interrupted.
-
final
def
isLeft[A](assertion: Assertion[A]): Assertion[Either[A, Any]]
Makes a new assertion that requires a Left value satisfying a specified assertion.
-
final
def
isLessThan[A](reference: A)(implicit arg0: Numeric[A]): Assertion[A]
Makes a new assertion that requires the numeric value be less than the specified reference value.
-
final
def
isLessThanEqualTo[A](reference: A)(implicit arg0: Numeric[A]): Assertion[A]
Makes a new assertion that requires the numeric value be less than or equal to the specified reference value.
-
final
val
isNonEmpty: Assertion[Iterable[Any]]
Makes a new assertion that requires an Iterable to be non empty.
-
final
val
isNonEmptyString: Assertion[String]
Makes a new assertion that requires a given string to be non empty
-
final
val
isNone: Assertion[Option[Any]]
Makes a new assertion that requires a None value.
-
final
def
isRight[A](assertion: Assertion[A]): Assertion[Either[Any, A]]
Makes a new assertion that requires a Right value satisfying a specified assertion.
-
final
def
isSome[A](assertion: Assertion[A]): Assertion[Option[A]]
Makes a new assertion that requires a Some value satisfying the specified assertion.
-
final
def
isSubtype[A](assertion: Assertion[A])(implicit C: ClassTag[A]): Assertion[Any]
Makes an assertion that requires a value have the specified type.
Makes an assertion that requires a value have the specified type.
Example:
assert(Duration.fromNanos(1), isSubtype[Duration.Finite](Assertion.anything)) -
final
def
isTrue: Assertion[Boolean]
Makes a new assertion that requires a value be true.
-
final
def
isUnit: Assertion[Any]
Makes a new assertion that requires the value be unit.
-
final
def
isWithin[A](min: A, max: A)(implicit arg0: Numeric[A]): Assertion[A]
Returns a new assertion that requires a numeric value to fall within a specified min and max (inclusive).
-
final
def
matchesRegex(regex: String): Assertion[String]
Makes a new assertion that requires a given string to match the specified regular expression.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
not[A](assertion: Assertion[A]): Assertion[A]
Makes a new assertion that negates the specified assertion.
-
final
val
nothing: Assertion[Any]
Makes a new assertion that always fails.
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
startsWith(prefix: String): Assertion[String]
Makes a new assertion that requires a given string to start with a specified prefix
-
final
def
succeeds[A](assertion: Assertion[A]): Assertion[Exit[Any, A]]
Makes a new assertion that requires an exit value to succeed.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
throws[A](assertion: Assertion[Throwable]): Assertion[A]
Returns a new assertion that requires the expression to throw.
-
final
def
throwsA[E](implicit arg0: ClassTag[E]): Assertion[Any]
Returns a new assertion that requires the expression to throw an instance of given type (or its subtype).
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- object Render
- object RenderParam