This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for Matchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for Matchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for Matchers
for an overview of
the matchers DSL.
This class is used in conjunction with an implicit conversion to enable will
methods to
be invoked on objects of type Any
.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for InspectorsMatchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for Matchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for Matchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for Matchers
for an overview of
the matchers DSL.
This class is used in conjunction with an implicit conversion to enable withGroup
and withGroups
methods to
be invoked on Regex
s.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for Matchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for InspectorsMatchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for InspectorsMatchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for InspectorsMatchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for Matchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for InspectorsMatchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for Matchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for Matchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for Matchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for InspectorsMatchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for Matchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for InspectorsMatchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for InspectorsMatchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for Matchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for Matchers
for an overview of
the matchers DSL.
This class is used in conjunction with an implicit conversion to enable will
methods to
be invoked on String
s.
This class supports the syntax of FlatSpec
, WordSpec
, fixture.FlatSpec
,
and fixture.WordSpec
.
This class supports the syntax of FlatSpec
, WordSpec
, fixture.FlatSpec
,
and fixture.WordSpec
.
This class is used in conjunction with an implicit conversion to enable will
methods to
be invoked on String
s.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for Matchers
for an overview of
the matchers DSL.
This class is part of the ScalaTest matchers DSL.
This class is part of the ScalaTest matchers DSL. Please see the documentation for Matchers
for an overview of
the matchers DSL.
This method enables the following syntax:
This method enables the following syntax:
num will (not be < (10) and not be > (17)) ^
This method enables the following syntax:
This method enables the following syntax:
num will (not be <= (10) and not be > (17)) ^
This method enables the following syntax:
This method enables the following syntax:
num will (not be > (10) and not be < (7)) ^
This method enables the following syntax:
This method enables the following syntax:
num will (not be >= (10) and not be < (7)) ^
This method enables the following syntax:
This method enables the following syntax:
a [RuntimeException] will be thrownBy { ... } ^
This field enables the following syntax:
This field enables the following syntax:
badBook will not be a ('goodRead) ^
This method enables the following syntax for String
:
This method enables the following syntax for String
:
all(str) will fullymatch regex ("Hel*o world".r) ^
This method enables the following syntax for java.util.Map
:
This method enables the following syntax for java.util.Map
:
all(jmap) will fullymatch regex ("Hel*o world".r) ^
This method enables the following syntax:
This method enables the following syntax:
all(xs) will fullymatch regex ("Hel*o world".r) ^
This method enables the following syntax:
This method enables the following syntax:
List(1, 2, 3) will contain (allElementsOf(1, 2)) ^
This method enables the following syntax:
This method enables the following syntax:
List(1, 2, 3) will contain (allOf(1, 2)) ^
This method enables the following syntax:
This method enables the following syntax:
an [Exception] will be thrownBy { ... } ^
This field enables the following syntax:
This field enables the following syntax:
badBook will not be an (excellentRead) ^
This method enables the following syntax for String
:
This method enables the following syntax for String
:
atLeast(1, str) will fullymatch regex ("Hel*o world".r) ^
This method enables the following syntax for java.util.Map
:
This method enables the following syntax for java.util.Map
:
atLeast(1, jmap) will fullymatch regex ("Hel*o world".r) ^
This method enables the following syntax:
This method enables the following syntax:
atLeast(1, xs) will fullymatch regex ("Hel*o world".r) ^
This method enables the following syntax:
This method enables the following syntax:
List(1, 2, 3) will contain (atLeastOneElementOf (List(1, 2))) ^
This method enables the following syntax:
This method enables the following syntax:
List(1, 2, 3) will contain (atLeastOneOf(1, 2)) ^
This method enables the following syntax for String
:
This method enables the following syntax for String
:
atMost(3, str) will fullymatch regex ("Hel*o world".r) ^
This method enables the following syntax for java.util.Map
:
This method enables the following syntax for java.util.Map
:
atMost(3, jmap) will fullymatch regex ("Hel*o world".r) ^
This method enables the following syntax:
This method enables the following syntax:
atMost(3, xs) will fullymatch regex ("Hel*o world".r) ^
This method enables the following syntax:
This method enables the following syntax:
List(1, 2, 3) will contain (atMostOneElementOf (List(1, 2))) ^
This method enables the following syntax:
This method enables the following syntax:
List(1, 2, 3) will contain (atMostOneOf(1, 2)) ^
This field enables syntax such as the following:
This field enables syntax such as the following:
obj will (be theSameInstanceAs (string) and be theSameInstanceAs (string)) ^
This method enables the following syntax for String
:
This method enables the following syntax for String
:
between(1, 3, str) will fullymatch regex ("Hel*o world".r) ^
This method enables the following syntax for java.util.Map
:
This method enables the following syntax for java.util.Map
:
between(1, 3, jmap) will fullymatch regex ("Hel*o world".r) ^
This method enables the following syntax:
This method enables the following syntax:
between(1, 3, xs) will fullymatch regex ("Hel*o world".r) ^
Implicit conversion that makes (x > 0) implies expect(x > -1) syntax works
Implicit conversion that makes (x > 0) implies expect(x > -1) syntax works
This field enables the following syntax:
This field enables the following syntax:
"val a: String = 1" willNot compile ^
This field enables syntax such as the following:
This field enables syntax such as the following:
list will (contain ('a') and have length (7)) ^
Implicitly converts an object of type T
to a AnyWillWrapper[T]
,
to enable will
methods to be invokable on that object.
Implicitly converts an object of type T
to a AnyWillWrapper[T]
,
to enable will
methods to be invokable on that object.
Implicitly converts an object of type scala.util.matching.Regex
to a RegexWrapper
,
to enable withGroup
and withGroups
methods to be invokable on that object.
Implicitly converts an object of type scala.util.matching.Regex
to a RegexWrapper
,
to enable withGroup
and withGroups
methods to be invokable on that object.
Implicitly converts an object of type java.lang.String
to a StringWillWrapper
,
to enable will
methods to be invokable on that object.
Implicitly converts an object of type java.lang.String
to a StringWillWrapper
,
to enable will
methods to be invokable on that object.
Implicitly converts an object of type String
to a StringWillWrapperForVerb
,
to enable will
methods to be invokable on that object.
Implicitly converts an object of type String
to a StringWillWrapperForVerb
,
to enable will
methods to be invokable on that object.
This field enables the following syntax:
This field enables the following syntax:
seq will be (defined) ^
This method enables the following syntax:
This method enables the following syntax:
list will (not be definedAt (7) and not be definedAt (9)) ^
This field enables the following syntax:
This field enables the following syntax:
list will be (empty) ^
This field enables syntax such as the following:
This field enables syntax such as the following:
string will (endWith ("ago") and include ("score")) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result will equal (null) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
result will equal (100 +- 1) ^
This method enables the following syntax:
This method enables the following syntax:
result will equal (7) ^
The left will equal (right)
syntax works by calling ==
on the left
value, passing in the right
value, on every type except arrays. If both left
and right are arrays, deep
will be invoked on both left
and right
before comparing them with ==. Thus, even though this expression
will yield false, because Array
's equals
method compares object identity:
Array(1, 2) == Array(1, 2) // yields false
The following expression will not result in a TestFailedException
, because ScalaTest will compare
the two arrays structurally, taking into consideration the equality of the array's contents:
Array(1, 2) will equal (Array(1, 2)) // succeeds (i.e., does not throw TestFailedException)
If you ever do want to verify that two arrays are actually the same object (have the same identity), you can use the
be theSameInstanceAs
syntax.
This method enables the following syntax for String
:
This method enables the following syntax for String
:
every(str) will fullymatch regex ("Hel*o world".r) ^
This method enables the following syntax for java.util.Map
:
This method enables the following syntax for java.util.Map
:
every(jmap) will fullymatch regex ("Hel*o world".r) ^
This method enables the following syntax:
This method enables the following syntax:
every(xs) will fullymatch regex ("Hel*o world".r) ^
This method enables the following syntax for String
:
This method enables the following syntax for String
:
exactly(str) will fullymatch regex ("Hel*o world".r) ^
This method enables the following syntax for java.util.Map
:
This method enables the following syntax for java.util.Map
:
exactly(jmap) will fullymatch regex ("Hel*o world".r) ^
This method enables the following syntax:
This method enables the following syntax:
exactly(xs) will fullymatch regex ("Hel*o world".r) ^
This field enables the following syntax:
This field enables the following syntax:
file will exist ^
This field enables syntax such as the following:
This field enables syntax such as the following:
string will (fullyMatch regex ("Hel*o, wor.d") and not have length (99)) ^
This field enables syntax such as the following:
This field enables syntax such as the following:
list will (have length (3) and not contain ('a')) ^
This method enables the following syntax:
This method enables the following syntax:
List(1, 2, 3) will contain (inOrder(1, 2)) ^
This method enables the following syntax:
This method enables the following syntax:
List(1, 2, 3) will contain (inOrderElementsOf List(1, 2)) ^
This method enables the following syntax:
This method enables the following syntax:
List(1, 2, 3) will contain (inOrderOnly(1, 2)) ^
This field enables syntax such as the following:
This field enables syntax such as the following:
string will (include ("hope") and not startWith ("no")) ^
This field enables the following syntax:
This field enables the following syntax:
map will not contain key (10) ^
This field enables the following syntax:
This field enables the following syntax:
"hi" will not have length (3) ^
This field enables the following syntax:
This field enables the following syntax:
result will matchPattern { case Person("Bob", _) => } ^
This method enables the following syntax:
This method enables the following syntax:
exception will not have message ("file not found") ^
This method enables the following syntax for String
:
This method enables the following syntax for String
:
no(str) will fullymatch regex ("Hel*o world".r) ^
This method enables the following syntax for java.util.Map
:
This method enables the following syntax for java.util.Map
:
no(jmap) will fullymatch regex ("Hel*o world".r) ^
This method enables the following syntax:
This method enables the following syntax:
no(xs) will fullymatch regex ("Hel*o world".r) ^
This method enables the following syntax:
This method enables the following syntax:
List(1, 2, 3) will contain (noElementsOf List(1, 2)) ^
This field enables the following syntax:
This field enables the following syntax:
noException will be thrownBy ^
This method enables the following syntax:
This method enables the following syntax:
List(1, 2, 3) will contain (noneOf(1, 2)) ^
This field enables syntax like the following:
This field enables syntax like the following:
myFile will (not be an (directory) and not have ('name ("foo.bar"))) ^
This method enables syntax such as the following:
This method enables syntax such as the following:
book will have (message ("A TALE OF TWO CITIES") (of [Book]), title ("A Tale of Two Cities")) ^
This method enables the following syntax:
This method enables the following syntax:
List(1, 2, 3) will contain (oneElementOf (List(1, 2))) ^
This method enables the following syntax:
This method enables the following syntax:
List(1, 2, 3) will contain (oneOf(1, 2)) ^
This method enables the following syntax:
This method enables the following syntax:
List(1, 2, 3) will contain (only(1, 2)) ^
This field enables the following syntax:
This field enables the following syntax:
file will be (readable) ^
This field enables the following syntax:
This field enables the following syntax:
"eight" will not fullyMatch regex ("""(-)?(\d+)(\.\d*)?""".r) ^
This field enables the following syntax:
This field enables the following syntax:
set will not have size (3) ^
This field enables the following syntax:
This field enables the following syntax:
seq will be (sorted) ^
This field enables syntax such as the following:
This field enables syntax such as the following:
string will (startWith ("Four") and include ("year")) ^
This method enables the following syntax:
This method enables the following syntax:
the [FileNotFoundException] will be thrownBy { ... } ^
This method enables the following syntax:
This method enables the following syntax:
List(1, 2, 3) will contain (theSameElementsAs(List(1, 2, 3))) ^
This method enables the following syntax:
This method enables the following syntax:
List(1, 2, 3) will contain (theSameElementsInOrderAs(List(1, 2))) ^
This field enables the following syntax:
This field enables the following syntax:
oneString will not be theSameInstanceAs (anotherString) ^
This method enables the following syntax:
This method enables the following syntax:
a [RuntimeException] will be thrownBy {...} ^
This field enables the following syntax:
This field enables the following syntax:
"val a: String = 1" willNot typeCheck ^
This field enables the following syntax:
This field enables the following syntax:
map will not contain value (10) ^
This field enables the following syntax:
This field enables the following syntax:
file will be (writable) ^
Companion object that facilitates the importing of
Matchers
members as an alternative to mixing it the trait. One use case is to importMatchers
members so you can use them in the Scala interpreter.