Helpers

weaver.Expectations$.Helpers
See theHelpers companion object
trait Helpers

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Helpers.type

Members list

Concise view

Type members

Classlikes

implicit class StringOps(str: String)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def exists[L[_], A](la: L[A])(f: A => Expectations)(implicit foldable: Foldable[L], pos: SourceLocation): Expectations

Checks that an assertion is true for at least one element in a foldable. Fails if the foldable is empty.

Checks that an assertion is true for at least one element in a foldable. Fails if the foldable is empty.

Attributes

Example:
   val xs =
     List("foo", "bar")
   // success
   exists(xs)(s => expect.eql("foo", s)

Expect macros

Expect macros

Attributes

def fail[A](hint: String)(implicit pos: SourceLocation): A => Expectations
def failure(hint: String)(implicit pos: SourceLocation): Expectations
def forEach[L[_], A](la: L[A])(f: A => Expectations)(implicit L: Foldable[L]): Expectations

Checks that an assertion is true for all elements in a foldable. Succeeds if the foldable is empty.

Checks that an assertion is true for all elements in a foldable. Succeeds if the foldable is empty.

Attributes

Example:
   val xs =
     List("foo", "bar")
   // success
   forEach(xs)(s => expect.eql(3, s.length)
def inEach[L[_], A](la: L[A])(f: A => Expectations)(implicit L: Foldable[L]): Expectations

Alias for forEach

Alias for forEach

Attributes

def matches[A](x: A)(f: PartialFunction[A, Expectations])(implicit pos: SourceLocation, A: Show[A]): Expectations

Checks that a given expression matches a certain pattern; fails otherwise.

Checks that a given expression matches a certain pattern; fails otherwise.

Attributes

Example:
   matches(Option(4)) { case Some(x) =>
     expect.eql(4, x)
   }
def not(assertion: Expectations)(implicit pos: SourceLocation): Expectations
def succeed[A]: A => Expectations
def verify(condition: Boolean, hint: String)(implicit pos: SourceLocation): Expectations
def verify(condition: Boolean)(implicit pos: SourceLocation): Expectations
def whenSuccess[F[_], A, E](fa: F[A])(f: A => Expectations)(implicit pos: SourceLocation, F: ApplicativeError[F, E], G: Foldable[F], E: Show[E]): Expectations

Checks that an ApplicativeError (like Either) is successful

Checks that an ApplicativeError (like Either) is successful

Attributes

Example:
   val res: Either[String, Int] =
     Right(4)
   whenSuccess(res) { n =>
     expect.eql(4, n)
   }

Concrete fields

Implicits

Implicits

final implicit def StringOps(str: String): StringOps