NodeMatcher

class NodeMatcher(e: Node, ignoreWhitespace: Boolean) extends Matcher[Node]
trait Matcher[Node]
trait Node => MatchResult
class Object
trait Matchable
class Any

Type members

Inherited classlikes

final class AndBeWord

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. Please see the documentation for Matchers for an overview of the matchers DSL.

Authors

Bill Venners

Inherited from
Matcher
final class AndContainWord(prettifier: Prettifier, pos: Position)

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. Please see the documentation for Matchers for an overview of the matchers DSL.

Authors

Bill Venners

Inherited from
Matcher
final class AndEndWithWord

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. Please see the documentation for Matchers for an overview of the matchers DSL.

Authors

Bill Venners

Inherited from
Matcher
final class AndFullyMatchWord

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. Please see the documentation for Matchers for an overview of the matchers DSL.

Authors

Bill Venners

Inherited from
Matcher
final class AndHaveWord

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. Please see the documentation for Matchers for an overview of the matchers DSL.

Authors

Bill Venners

Inherited from
Matcher
final class AndIncludeWord

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. Please see the documentation for Matchers for an overview of the matchers DSL.

Authors

Bill Venners

Inherited from
Matcher
final class AndNotWord

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. Please see the documentation for Matchers for an overview of the matchers DSL.

Authors

Bill Venners

Inherited from
Matcher
final class AndStartWithWord

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. Please see the documentation for Matchers for an overview of the matchers DSL.

Authors

Bill Venners

Inherited from
Matcher
final class OrBeWord

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. Please see the documentation for Matchers for an overview of the matchers DSL.

Authors

Bill Venners

Inherited from
Matcher
final class OrContainWord(prettifier: Prettifier, pos: Position)

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. Please see the documentation for Matchers for an overview of the matchers DSL.

Authors

Bill Venners

Inherited from
Matcher
final class OrEndWithWord

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. Please see the documentation for Matchers for an overview of the matchers DSL.

Authors

Bill Venners

Inherited from
Matcher
final class OrFullyMatchWord

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. Please see the documentation for Matchers for an overview of the matchers DSL.

Authors

Bill Venners

Inherited from
Matcher
final class OrHaveWord

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. Please see the documentation for Matchers for an overview of the matchers DSL.

Authors

Bill Venners

Inherited from
Matcher
final class OrIncludeWord

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. Please see the documentation for Matchers for an overview of the matchers DSL.

Authors

Bill Venners

Inherited from
Matcher
final class OrNotWord

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. Please see the documentation for Matchers for an overview of the matchers DSL.

Authors

Bill Venners

Inherited from
Matcher
final class OrStartWithWord

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. Please see the documentation for Matchers for an overview of the matchers DSL.

Authors

Bill Venners

Inherited from
Matcher

Value members

Concrete methods

override def apply(a: Node): MatchResult
Definition Classes
Matcher -> Function1

Inherited methods

def and(notExist: ResultOfNotExist): MatcherFactory1[Node, [S] =>> Existence[S]]

This method enables the following syntax:

This method enables the following syntax:

aMatcher and not (exist)
        ^
Inherited from
Matcher
def and(existWord: ExistWord): MatcherFactory1[Node, [S] =>> Existence[S]]

This method enables the following syntax:

This method enables the following syntax:

aMatcher and exist
        ^
Inherited from
Matcher
def and(notWord: NotWord): AndNotWord

This method enables the following syntax:

This method enables the following syntax:

aMatcher and not contain value (3)
        ^
Inherited from
Matcher
def and(endWithWord: EndWithWord): AndEndWithWord

This method enables the following syntax:

This method enables the following syntax:

aMatcher and endWith regex (decimalRegex)
        ^
Inherited from
Matcher
def and(startWithWord: StartWithWord): AndStartWithWord

This method enables the following syntax:

This method enables the following syntax:

aMatcher and startWith regex ("1.7")
        ^
Inherited from
Matcher
def and(includeWord: IncludeWord): AndIncludeWord

This method enables the following syntax:

This method enables the following syntax:

aMatcher and include regex ("wor.d")
        ^
Inherited from
Matcher
def and(fullyMatchWord: FullyMatchWord): AndFullyMatchWord

This method enables the following syntax:

This method enables the following syntax:

aMatcher and fullyMatch regex (decimalRegex)
        ^
Inherited from
Matcher
def and(beWord: BeWord): AndBeWord

This method enables the following syntax:

This method enables the following syntax:

aMatcher and be a ('file)
        ^
Inherited from
Matcher
def and(containWord: ContainWord)(prettifier: Prettifier, pos: Position): AndContainWord

This method enables the following syntax:

This method enables the following syntax:

aMatcher and contain key ("one")
        ^
Inherited from
Matcher
def and(haveWord: HaveWord): AndHaveWord

This method enables the following syntax:

This method enables the following syntax:

aMatcher and have size (3 - 1)
        ^
Inherited from
Matcher
def and[U, TC1[_]](rightMatcherFactory1: MatcherFactory1[U, TC1]): MatcherFactory1[Node & U, TC1]

Returns a MatcherFactory whose matcher method returns a Matcher, which has apply method that returns a MatchResult that represents the logical-and of the results of the wrapped and the passed MatcherFactory applied to the same value.

Returns a MatcherFactory whose matcher method returns a Matcher, which has apply method that returns a MatchResult that represents the logical-and of the results of the wrapped and the passed MatcherFactory applied to the same value.

Value Params
rightMatcherFactory1

the MatcherFactory to logical-and with this MatcherFactory

Returns

a MatcherFactory that performs the logical-and of this and the passed MatcherFactory

Inherited from
Matcher
def and[U <: Node](rightMatcher: Matcher[U]): Matcher[U]

Returns a matcher whose apply method returns a MatchResult that represents the logical-and of the results of the wrapped and the passed matcher applied to the same value.

Returns a matcher whose apply method returns a MatchResult that represents the logical-and of the results of the wrapped and the passed matcher applied to the same value.

The reason and has an upper bound on its type parameter is so that the Matcher resulting from an invocation of and will have the correct type parameter. If you call and on a Matcher[Orange], passing in a Matcher[Valencia], the result will have type Matcher[Valencia]. This is correct because both a Matcher[Orange] and a Matcher[Valencia] know how to match a Valencia (but a Matcher[Valencia] doesn't know how to match any old Orange). If you call and on a Matcher[Orange], passing in a Matcher[Fruit], the result will have type Matcher[Orange]. This is also correct because both a Matcher[Orange] and a Matcher[Fruit] know how to match an Orange (but a Matcher[Orange] doesn't know how to match any old Fruit).

Value Params
the

matcher to logical-and with this matcher

Returns

a matcher that performs the logical-and of this and the passed matcher

Inherited from
Matcher
@unspecialized
def andThen[A](g: MatchResult => A): Node => A
Inherited from
Function1
override def compose[U](g: U => Node): Matcher[U]

Compose this matcher with the passed function, returning a new matcher.

Compose this matcher with the passed function, returning a new matcher.

This method overrides compose on Function1 to return a more specific function type of Matcher. For example, given a beOdd matcher defined like this:

val beOdd =
 new Matcher[Int] {
   def apply(left: Int) =
     MatchResult(
       left % 2 == 1,
       left + " was not odd",
       left + " was odd"
     )
 }

You could use beOdd like this:

3 should beOdd
4 should not (beOdd)

If for some odd reason, you wanted a Matcher[String] that checked whether a string, when converted to an Int, was odd, you could make one by composing beOdd with a function that converts a string to an Int, like this:

val beOddAsInt = beOdd compose { (s: String) => s.toInt }

Now you have a Matcher[String] whose apply method first invokes the converter function to convert the passed string to an Int, then passes the resulting Int to beOdd. Thus, you could use beOddAsInt like this:

"3" should beOddAsInt
"4" should not (beOddAsInt)
Definition Classes
Matcher -> Function1
Inherited from
Matcher
def mapArgs(prettify: Any => String): Matcher[Node]

Creates a new Matcher that will produce MatchResults that contain error messages constructed using arguments that are transformed by the passed prettify function. In other words, the MatchResult produced by this Matcher will use arguments transformed by prettify function to construct the final error messages.

Creates a new Matcher that will produce MatchResults that contain error messages constructed using arguments that are transformed by the passed prettify function. In other words, the MatchResult produced by this Matcher will use arguments transformed by prettify function to construct the final error messages.

Value Params
prettify

a function with which to transform the arguments of error messages.

Returns

a new Matcher that will produce MatchResults that contain error messages constructed using arguments transformed by the passed prettify function.

Inherited from
Matcher
def mapResult(prettify: MatchResult => MatchResult): Matcher[Node]

Creates a new Matcher that will produce MatchResults by applying the original MatchResult produced by this Matcher to the passed prettify function. In other words, the MatchResult produced by this Matcher will be passed to prettify to produce the final MatchResult

Creates a new Matcher that will produce MatchResults by applying the original MatchResult produced by this Matcher to the passed prettify function. In other words, the MatchResult produced by this Matcher will be passed to prettify to produce the final MatchResult

Value Params
prettify

a function to apply to the original MatchResult produced by this Matcher

Returns

a new Matcher that will produce MatchResults by applying the original MatchResult produced by this Matcher to the passed prettify function

Inherited from
Matcher
def or(notExist: ResultOfNotExist): MatcherFactory1[Node, [S] =>> Existence[S]]

This method enables the following syntax:

This method enables the following syntax:

aMatcher or not (exist)
        ^
Inherited from
Matcher
def or(existWord: ExistWord): MatcherFactory1[Node, [S] =>> Existence[S]]

This method enables the following syntax:

This method enables the following syntax:

aMatcher or exist
        ^
Inherited from
Matcher
def or(notWord: NotWord): OrNotWord

This method enables the following syntax:

This method enables the following syntax:

aMatcher or not contain value (3)
        ^
Inherited from
Matcher
def or(endWithWord: EndWithWord): OrEndWithWord

This method enables the following syntax:

This method enables the following syntax:

aMatcher or endWith regex ("7b")
        ^
Inherited from
Matcher
def or(startWithWord: StartWithWord): OrStartWithWord

This method enables the following syntax:

This method enables the following syntax:

aMatcher or startWith regex ("1.7")
        ^
Inherited from
Matcher
def or(includeWord: IncludeWord): OrIncludeWord

This method enables the following syntax:

This method enables the following syntax:

aMatcher or include regex ("1.7")
        ^
Inherited from
Matcher
def or(fullyMatchWord: FullyMatchWord): OrFullyMatchWord

This method enables the following syntax:

This method enables the following syntax:

aMatcher or fullyMatch regex (decimal)
        ^
Inherited from
Matcher
def or(beWord: BeWord): OrBeWord

This method enables the following syntax:

This method enables the following syntax:

aMatcher or be a ('directory)
        ^
Inherited from
Matcher
def or(containWord: ContainWord)(prettifier: Prettifier, pos: Position): OrContainWord

This method enables the following syntax:

This method enables the following syntax:

aMatcher or contain value (1)
        ^
Inherited from
Matcher
def or(haveWord: HaveWord): OrHaveWord

This method enables the following syntax:

This method enables the following syntax:

aMatcher or have size (3 - 1)
        ^
Inherited from
Matcher
def or[U, TC1[_]](rightMatcherFactory1: MatcherFactory1[U, TC1]): MatcherFactory1[Node & U, TC1]

Returns a MatcherFactory whose matcher method returns a Matcher, which has apply method that returns a MatchResult that represents the logical-or of the results of the wrapped and the passed MatcherFactory applied to the same value.

Returns a MatcherFactory whose matcher method returns a Matcher, which has apply method that returns a MatchResult that represents the logical-or of the results of the wrapped and the passed MatcherFactory applied to the same value.

Value Params
rightMatcherFactory1

the MatcherFactory to logical-or with this MatcherFactory

Returns

a MatcherFactory that performs the logical-or of this and the passed MatcherFactory

Inherited from
Matcher
def or[U <: Node](rightMatcher: Matcher[U]): Matcher[U]

Returns a matcher whose apply method returns a MatchResult that represents the logical-or of the results of this and the passed matcher applied to the same value.

Returns a matcher whose apply method returns a MatchResult that represents the logical-or of the results of this and the passed matcher applied to the same value.

The reason or has an upper bound on its type parameter is so that the Matcher resulting from an invocation of or will have the correct type parameter. If you call or on a Matcher[Orange], passing in a Matcher[Valencia], the result will have type Matcher[Valencia]. This is correct because both a Matcher[Orange] and a Matcher[Valencia] know how to match a Valencia (but a Matcher[Valencia] doesn't know how to match any old Orange). If you call or on a Matcher[Orange], passing in a Matcher[Fruit], the result will have type Matcher[Orange]. This is also correct because both a Matcher[Orange] and a Matcher[Fruit] know how to match an Orange (but a Matcher[Orange] doesn't know how to match any old Fruit).

Value Params
rightMatcher

the matcher to logical-or with this matcher

Returns

a matcher that performs the logical-or of this and the passed matcher

Inherited from
Matcher
override def toString(): String
Definition Classes
Function1 -> Any
Inherited from
Function1