StringMustWrapperForVerb

org.scalatest.verbs.MustVerb.StringMustWrapperForVerb

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 must methods to be invoked on Strings.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def must(right: String)(implicit svsi: StringVerbStringInvocation): ResultOfStringPassedToVerb

Supports test registration in FlatSpec and fixture.FlatSpec.

Supports test registration in FlatSpec and fixture.FlatSpec.

For example, this method enables syntax such as the following in FlatSpec and fixture.FlatSpec:

"A Stack (when empty)" must "be empty" in { ... }
                      ^

FlatSpec passes in a function via the implicit parameter that takes three strings and results in a ResultOfStringPassedToVerb. This method simply invokes this function, passing in leftSideString, the verb string "must", and right, and returns the result.

Attributes

Supports shared test registration in FlatSpec and fixture.FlatSpec.

Supports shared test registration in FlatSpec and fixture.FlatSpec.

For example, this method enables syntax such as the following in FlatSpec and fixture.FlatSpec:

"A Stack (with one item)" must behave like nonEmptyStack(stackWithOneItem, lastValuePushed)
                         ^

FlatSpec and fixture.FlatSpec passes in a function via the implicit parameter that takes a string and results in a BehaveWord. This method simply invokes this function, passing in leftSideString, and returns the result.

Attributes

def must(right: => Unit)(implicit fun: StringVerbBlockRegistration): Unit

Supports the registration of subject descriptions in WordSpec and fixture.WordSpec.

Supports the registration of subject descriptions in WordSpec and fixture.WordSpec.

For example, this method enables syntax such as the following in WordSpec and fixture.WordSpec:

"A Stack (when empty)" must { ...
                      ^

WordSpec passes in a function via the implicit parameter of type StringVerbBlockRegistration, a function that takes two strings and a no-arg function and results in Unit. This method simply invokes this function, passing in leftSideString, the verb string "must", and the right by-name parameter transformed into a no-arg function.

Attributes

def must(resultOfAfterWordApplication: ResultOfAfterWordApplication)(implicit swawr: SubjectWithAfterWordRegistration): Unit

Supports the registration of subject descriptions with after words in WordSpec and fixture.WordSpec.

Supports the registration of subject descriptions with after words in WordSpec and fixture.WordSpec.

For example, this method enables syntax such as the following in WordSpec and fixture.WordSpec:

  def provide = afterWord("provide")

 "The ScalaTest Matchers DSL" must provide {
                              ^

WordSpec passes in a function via the implicit parameter that takes two strings and a ResultOfAfterWordApplication and results in Unit. This method simply invokes this function, passing in leftSideString, the verb string "must", and the ResultOfAfterWordApplication passed to must.

Attributes

Abstract fields

val leftSideString: String
val pos: Position