Existence

trait Existence[-S]

Supertrait for typeclasses that enable the exist matcher syntax.

An Existence[S] provides access to the "existence nature" of type S in such a way that exist matcher syntax can be used with type S. A S can be any type for which the concept of existence makes sense, such as java.io.File. ScalaTest provides implicit implementations for java.io.File. You can enable the exist matcher syntax on your own type U by defining a Existence[U] for the type and making it available implicitly.

ScalaTest provides an implicit Existence instance for java.io.File in the Existence companion object.

Companion:
object
class Object
trait Matchable
class Any

Value members

Abstract methods

def exists(thing: S): Boolean

Determines whether the passed thing exists, i.e., whether the passed java.io.File exists.

Determines whether the passed thing exists, i.e., whether the passed java.io.File exists.

Value parameters:
thing

the thing to check for existence

Returns:

true if passed thing exists, false otherwise