object Traversables extends AnyFlatSpec with Matchers with Section
- Alphabetic
- By Inheritance
- Traversables
- Section
- Matchers
- Explicitly
- MatcherWords
- Tolerance
- AnyFlatSpec
- AnyFlatSpecLike
- Documenting
- Alerting
- Notifying
- Informing
- CanVerb
- MustVerb
- ShouldVerb
- TestRegistration
- TestSuite
- Suite
- Serializable
- Assertions
- TripleEquals
- TripleEqualsSupport
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- final class AWord extends AnyRef
- Definition Classes
- Matchers
- final class AnWord extends AnyRef
- Definition Classes
- Matchers
- sealed class AnyShouldWrapper[T] extends AnyRef
- Definition Classes
- Matchers
- final class BehaviorWord extends AnyRef
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- class CheckingEqualizer[L] extends AnyRef
- Definition Classes
- TripleEqualsSupport
- sealed class Collected extends Serializable
- Attributes
- protected
- Definition Classes
- Matchers
- class DecidedByEquality[A] extends Equality[A]
- Definition Classes
- Explicitly
- class DecidedWord extends AnyRef
- Definition Classes
- Explicitly
- class DeterminedByEquivalence[T] extends Equivalence[T]
- Definition Classes
- Explicitly
- class DeterminedWord extends AnyRef
- Definition Classes
- Explicitly
- class Equalizer[L] extends AnyRef
- Definition Classes
- TripleEqualsSupport
- final class HavePropertyMatcherGenerator extends AnyRef
- Definition Classes
- Matchers
- final class IgnoreVerbString extends AnyRef
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- final class IgnoreVerbStringTaggedAs extends AnyRef
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- final class IgnoreWord extends AnyRef
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- final class InAndIgnoreMethods extends AnyRef
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- final class InAndIgnoreMethodsAfterTaggedAs extends AnyRef
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- final class ItVerbString extends AnyRef
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- final class ItVerbStringTaggedAs extends AnyRef
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- final class ItWord extends AnyRef
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- final class KeyWord extends AnyRef
- Definition Classes
- Matchers
- trait NoArgTest extends () => Outcome with TestData
- Attributes
- protected
- Definition Classes
- TestSuite
- final class PlusOrMinusWrapper[T] extends AnyRef
- Definition Classes
- Tolerance
- final class RegexWord extends AnyRef
- Definition Classes
- Matchers
- final class RegexWrapper extends AnyRef
- Definition Classes
- Matchers
- class ResultOfBeWordForAny[T] extends AnyRef
- Definition Classes
- Matchers
- sealed class ResultOfBeWordForCollectedAny[T] extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfBeWordForCollectedArray[T] extends ResultOfBeWordForCollectedAny[Array[T]]
- Definition Classes
- Matchers
- final class ResultOfCollectedAny[T] extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfContainWordForCollectedAny[T] extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfEndWithWordForCollectedString extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfEndWithWordForString extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfFullyMatchWordForCollectedString extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfFullyMatchWordForString extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfHaveWordForCollectedExtent[A] extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfHaveWordForExtent[A] extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfIncludeWordForCollectedString extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfIncludeWordForString extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfNotWordForCollectedAny[T] extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfStartWithWordForCollectedString extends AnyRef
- Definition Classes
- Matchers
- final class ResultOfStartWithWordForString extends AnyRef
- Definition Classes
- Matchers
- trait StringCanWrapperForVerb extends AnyRef
- Definition Classes
- CanVerb
- trait StringMustWrapperForVerb extends AnyRef
- Definition Classes
- MustVerb
- final class StringShouldWrapper extends AnyShouldWrapper[String] with org.scalatest.matchers.should.Matchers.StringShouldWrapperForVerb
- Definition Classes
- Matchers
- trait StringShouldWrapperForVerb extends AnyRef
- Definition Classes
- ShouldVerb
- class TheAfterWord extends AnyRef
- Definition Classes
- Explicitly
- final class TheSameInstanceAsPhrase extends AnyRef
- Definition Classes
- Matchers
- final class TheyVerbString extends AnyRef
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- final class TheyVerbStringTaggedAs extends AnyRef
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- final class TheyWord extends AnyRef
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- final class ValueWord extends AnyRef
- Definition Classes
- Matchers
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def !==[T](right: Spread[T]): TripleEqualsInvocationOnSpread[T]
- Definition Classes
- TripleEqualsSupport
- def !==(right: Null): TripleEqualsInvocation[Null]
- Definition Classes
- TripleEqualsSupport
- def !==[T](right: T): TripleEqualsInvocation[T]
- Definition Classes
- TripleEqualsSupport
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def <[T](right: T)(implicit arg0: Ordering[T]): ResultOfLessThanComparison[T]
- Definition Classes
- Matchers
- def <=[T](right: T)(implicit arg0: Ordering[T]): ResultOfLessThanOrEqualToComparison[T]
- Definition Classes
- Matchers
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def ===[T](right: Spread[T]): TripleEqualsInvocationOnSpread[T]
- Definition Classes
- TripleEqualsSupport
- def ===(right: Null): TripleEqualsInvocation[Null]
- Definition Classes
- TripleEqualsSupport
- def ===[T](right: T): TripleEqualsInvocation[T]
- Definition Classes
- TripleEqualsSupport
- def >[T](right: T)(implicit arg0: Ordering[T]): ResultOfGreaterThanComparison[T]
- Definition Classes
- Matchers
- def >=[T](right: T)(implicit arg0: Ordering[T]): ResultOfGreaterThanOrEqualToComparison[T]
- Definition Classes
- Matchers
- def a[T](implicit arg0: ClassTag[T]): ResultOfATypeInvocation[T]
- Definition Classes
- Matchers
- val a: AWord
- Definition Classes
- Matchers
- def addStringFunctionTraversables(res0: String): Assertion
addString
will take a StringBuilder to add the contents of list into the builder. - val after: TheAfterWord
- Definition Classes
- Explicitly
- def alert: Alerter
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike → Alerting
- def all(xs: String)(implicit collecting: Collecting[Char, String], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Char]
- Definition Classes
- Matchers
- def all[K, V, JMAP[k, v] <: Map[k, v]](xs: JMAP[K, V])(implicit collecting: Collecting[Entry[K, V], JMAP[K, V]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Entry[K, V]]
- Definition Classes
- Matchers
- def all[K, V, MAP[k, v] <: GenMap[k, v]](xs: MAP[K, V])(implicit collecting: Collecting[(K, V), GenTraversable[(K, V)]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[(K, V)]
- Definition Classes
- Matchers
- def all[E, C[_]](xs: C[E])(implicit collecting: Collecting[E, C[E]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[E]
- Definition Classes
- Matchers
- def allElementsOf[R](elements: GenTraversable[R]): ResultOfAllElementsOfApplication
- Definition Classes
- Matchers
- def allOf(firstEle: Any, secondEle: Any, remainingEles: Any*)(implicit pos: Position): ResultOfAllOfApplication
- Definition Classes
- Matchers
- def an[T](implicit arg0: ClassTag[T]): ResultOfAnTypeInvocation[T]
- Definition Classes
- Matchers
- val an: AnWord
- Definition Classes
- Matchers
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- macro def assert(condition: Boolean, clue: Any)(implicit prettifier: Prettifier, pos: Position): Assertion
- Definition Classes
- Assertions
- macro def assert(condition: Boolean)(implicit prettifier: Prettifier, pos: Position): Assertion
- Definition Classes
- Assertions
- macro def assertCompiles(code: String)(implicit pos: Position): Assertion
- Definition Classes
- Assertions
- macro def assertDoesNotCompile(code: String)(implicit pos: Position): Assertion
- Definition Classes
- Assertions
- def assertResult(expected: Any)(actual: Any)(implicit prettifier: Prettifier, pos: Position): Assertion
- Definition Classes
- Assertions
- def assertResult(expected: Any, clue: Any)(actual: Any)(implicit prettifier: Prettifier, pos: Position): Assertion
- Definition Classes
- Assertions
- def assertThrows[T <: AnyRef](f: => Any)(implicit classTag: ClassTag[T], pos: Position): Assertion
- Definition Classes
- Assertions
- macro def assertTypeError(code: String)(implicit pos: Position): Assertion
- Definition Classes
- Assertions
- macro def assume(condition: Boolean, clue: Any)(implicit prettifier: Prettifier, pos: Position): Assertion
- Definition Classes
- Assertions
- macro def assume(condition: Boolean)(implicit prettifier: Prettifier, pos: Position): Assertion
- Definition Classes
- Assertions
- def atLeast(num: Int, xs: String)(implicit collecting: Collecting[Char, String], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Char]
- Definition Classes
- Matchers
- def atLeast[K, V, JMAP[k, v] <: Map[k, v]](num: Int, xs: JMAP[K, V])(implicit collecting: Collecting[Entry[K, V], JMAP[K, V]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Entry[K, V]]
- Definition Classes
- Matchers
- def atLeast[K, V, MAP[k, v] <: GenMap[k, v]](num: Int, xs: MAP[K, V])(implicit collecting: Collecting[(K, V), GenTraversable[(K, V)]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[(K, V)]
- Definition Classes
- Matchers
- def atLeast[E, C[_]](num: Int, xs: C[E])(implicit collecting: Collecting[E, C[E]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[E]
- Definition Classes
- Matchers
- def atLeastOneElementOf(elements: GenTraversable[Any]): ResultOfAtLeastOneElementOfApplication
- Definition Classes
- Matchers
- def atLeastOneOf(firstEle: Any, secondEle: Any, remainingEles: Any*)(implicit pos: Position): ResultOfAtLeastOneOfApplication
- Definition Classes
- Matchers
- def atMost(num: Int, xs: String)(implicit collecting: Collecting[Char, String], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Char]
- Definition Classes
- Matchers
- def atMost[K, V, JMAP[k, v] <: Map[k, v]](num: Int, xs: JMAP[K, V])(implicit collecting: Collecting[Entry[K, V], JMAP[K, V]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Entry[K, V]]
- Definition Classes
- Matchers
- def atMost[K, V, MAP[k, v] <: GenMap[k, v]](num: Int, xs: MAP[K, V])(implicit collecting: Collecting[(K, V), GenTraversable[(K, V)]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[(K, V)]
- Definition Classes
- Matchers
- def atMost[E, C[_]](num: Int, xs: C[E])(implicit collecting: Collecting[E, C[E]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[E]
- Definition Classes
- Matchers
- def atMostOneElementOf[R](elements: GenTraversable[R]): ResultOfAtMostOneElementOfApplication
- Definition Classes
- Matchers
- def atMostOneOf(firstEle: Any, secondEle: Any, remainingEles: Any*)(implicit pos: Position): ResultOfAtMostOneOfApplication
- Definition Classes
- Matchers
- val be: BeWord
- Definition Classes
- MatcherWords
- val behave: BehaveWord
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- val behavior: BehaviorWord
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- def between(from: Int, upTo: Int, xs: String)(implicit collecting: Collecting[Char, String], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Char]
- Definition Classes
- Matchers
- def between[K, V, JMAP[k, v] <: Map[k, v]](from: Int, upTo: Int, xs: JMAP[K, V])(implicit collecting: Collecting[Entry[K, V], JMAP[K, V]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Entry[K, V]]
- Definition Classes
- Matchers
- def between[E, C[_]](from: Int, upTo: Int, xs: C[E])(implicit collecting: Collecting[E, C[E]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[E]
- Definition Classes
- Matchers
- def cancel(cause: Throwable)(implicit pos: Position): Nothing
- Definition Classes
- Assertions
- def cancel(message: String, cause: Throwable)(implicit pos: Position): Nothing
- Definition Classes
- Assertions
- def cancel(message: String)(implicit pos: Position): Nothing
- Definition Classes
- Assertions
- def cancel()(implicit pos: Position): Nothing
- Definition Classes
- Assertions
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def collectFunctionIITraversables(res0: List[Int]): Assertion
Two case fragments can be chained to create a more robust result:
- def collectFunctionTraversables(res0: List[Int]): Assertion
collect
will apply a partial function to all elements of aTraversable
and return a different collection.collect
will apply a partial function to all elements of aTraversable
and return a different collection. In this exercise, a case fragment is a partial function: - val compile: CompileWord
- Definition Classes
- MatcherWords
- val contain: ContainWord
- Definition Classes
- MatcherWords
- def convertEquivalenceToAToBConstraint[A, B](equivalenceOfB: Equivalence[B])(implicit ev: <:<[A, B]): CanEqual[A, B]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- def convertEquivalenceToBToAConstraint[A, B](equivalenceOfA: Equivalence[A])(implicit ev: <:<[B, A]): CanEqual[A, B]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- implicit def convertNumericToPlusOrMinusWrapper[T](pivot: T)(implicit arg0: Numeric[T]): PlusOrMinusWrapper[T]
- Definition Classes
- Tolerance
- implicit def convertSymbolToHavePropertyMatcherGenerator(symbol: Symbol)(implicit prettifier: Prettifier, pos: Position): HavePropertyMatcherGenerator
- Definition Classes
- Matchers
- implicit def convertToAnyShouldWrapper[T](o: T)(implicit pos: Position, prettifier: Prettifier): AnyShouldWrapper[T]
- Definition Classes
- Matchers
- def convertToCheckingEqualizer[T](left: T): CheckingEqualizer[T]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- implicit def convertToEqualizer[T](left: T): Equalizer[T]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- implicit def convertToInAndIgnoreMethods(resultOfStringPassedToVerb: ResultOfStringPassedToVerb): InAndIgnoreMethods
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- implicit def convertToInAndIgnoreMethodsAfterTaggedAs(resultOfTaggedAsInvocation: ResultOfTaggedAsInvocation): InAndIgnoreMethodsAfterTaggedAs
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- implicit def convertToRegexWrapper(o: Regex): RegexWrapper
- Definition Classes
- Matchers
- implicit def convertToStringCanWrapper(o: String)(implicit position: Position): StringCanWrapperForVerb
- Definition Classes
- CanVerb
- implicit def convertToStringMustWrapperForVerb(o: String)(implicit position: Position): StringMustWrapperForVerb
- Definition Classes
- MustVerb
- implicit def convertToStringShouldWrapper(o: String)(implicit pos: Position, prettifier: Prettifier): StringShouldWrapper
- Definition Classes
- Matchers
- implicit def convertToStringShouldWrapperForVerb(o: String)(implicit position: Position): StringShouldWrapperForVerb
- Definition Classes
- ShouldVerb
- def countFunctionTraversables(res0: Int): Assertion
count
will count the number of elements that satisfy a predicate in aTraversable
: - val decided: DecidedWord
- Definition Classes
- Explicitly
- def defaultEquality[A]: Equality[A]
- Definition Classes
- TripleEqualsSupport
- val defined: DefinedWord
- Definition Classes
- MatcherWords
- def definedAt[T](right: T): ResultOfDefinedAt[T]
- Definition Classes
- Matchers
- val determined: DeterminedWord
- Definition Classes
- Explicitly
- def dropFunctionTraversables(res0: List[Int]): Assertion
drop
will take the rest of theTraversable
except the number of elements given: - def dropWhileFunctionTraversables(res0: List[Int]): Assertion
dropWhile
will continually drop elements until a predicate is no longer satisfied: - val empty: EmptyWord
- Definition Classes
- MatcherWords
- val endWith: EndWithWord
- Definition Classes
- MatcherWords
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equal(o: Null): Matcher[AnyRef]
- Definition Classes
- Matchers
- def equal[T](spread: Spread[T]): Matcher[T]
- Definition Classes
- Matchers
- def equal(right: Any): MatcherFactory1[Any, Equality]
- Definition Classes
- MatcherWords
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def every(xs: String)(implicit collecting: Collecting[Char, String], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Char]
- Definition Classes
- Matchers
- def every[K, V, JMAP[k, v] <: Map[k, v]](xs: JMAP[K, V])(implicit collecting: Collecting[Entry[K, V], JMAP[K, V]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Entry[K, V]]
- Definition Classes
- Matchers
- def every[K, V, MAP[k, v] <: Map[k, v]](xs: MAP[K, V])(implicit collecting: Collecting[(K, V), GenTraversable[(K, V)]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[(K, V)]
- Definition Classes
- Matchers
- def every[E, C[_]](xs: C[E])(implicit collecting: Collecting[E, C[E]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[E]
- Definition Classes
- Matchers
- def exactly(num: Int, xs: String)(implicit collecting: Collecting[Char, String], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Char]
- Definition Classes
- Matchers
- def exactly[K, V, JMAP[k, v] <: Map[k, v]](num: Int, xs: JMAP[K, V])(implicit collecting: Collecting[Entry[K, V], JMAP[K, V]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Entry[K, V]]
- Definition Classes
- Matchers
- def exactly[K, V, MAP[k, v] <: GenMap[k, v]](num: Int, xs: MAP[K, V])(implicit collecting: Collecting[(K, V), GenTraversable[(K, V)]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[(K, V)]
- Definition Classes
- Matchers
- def exactly[E, C[_]](num: Int, xs: C[E])(implicit collecting: Collecting[E, C[E]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[E]
- Definition Classes
- Matchers
- final def execute(testName: String, configMap: ConfigMap, color: Boolean, durations: Boolean, shortstacks: Boolean, fullstacks: Boolean, stats: Boolean): Unit
- Definition Classes
- Suite
- val exist: ExistWord
- Definition Classes
- MatcherWords
- def existsFunctionTraversables(res0: Boolean): Assertion
exists
will determine if a predicate is valid for some members of aTraversable
: - def expectedTestCount(filter: Filter): Int
- Definition Classes
- Suite
- def fail(cause: Throwable)(implicit pos: Position): Nothing
- Definition Classes
- Assertions
- def fail(message: String, cause: Throwable)(implicit pos: Position): Nothing
- Definition Classes
- Assertions
- def fail(message: String)(implicit pos: Position): Nothing
- Definition Classes
- Assertions
- def fail()(implicit pos: Position): Nothing
- Definition Classes
- Assertions
- def filterFunctionTraversables(res0: Array[Int]): Assertion
filter
will take out all elements that don't satisfy a predicate.filter
will take out all elements that don't satisfy a predicate. (AnArray
is alsoTraversable
.) - def filterNotFunctionTraversables(res0: Array[Int]): Assertion
filterNot
will take out all elements that satisfy a predicate: - def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def findFunctionTraversables(res0: Option[Int], res1: Option[Int]): Assertion
find
will locate the first item that matches the predicatep
asSome
, orNone
if an element is not found: - def flatMapFunctionTraversables(res0: List[Int]): Assertion
flatMap
will not only apply the given function on all elements of aTraversable
, but all elements within the elements andflatten
the results: - def flatMapOfOptionsTraversables(res0: List[Int]): Assertion
flatMap
ofOptions
will filter out allNone
s but keep theSome
s: - def flattenFunctionTraversables(res0: List[Int]): Assertion
flatten
will "pack" all childTraversables
into a singleTraversable
: - def foldLeftFunctionTraversables(res0: Int, res1: Int, res2: Int): Assertion
foldLeft
will combine an operation starting with a seed and combining from the left.foldLeft
will combine an operation starting with a seed and combining from the left.foldLeft
takes as a first parameter the initial value of the fold. Once the fold is established, you provide a function that takes two arguments. The first argument is the running total of the operation, and the second element is the next element of the list.Given a
Traversable (x1, x2, x3, x4)
, an initial value ofinit
, an operationop
,foldLeft
is defined as:(((init op x1) op x2) op x3) op x4)
- def foldRightFunctionTraversables(res0: Int, res1: Int, res2: Int): Assertion
foldRight
will combine an operation starting with a seed and combining from the right.foldRight
will combine an operation starting with a seed and combining from the right.foldRight
takes as a first parameter the initial value of the fold. Once the fold is established, you provide a function that takes two elements. The first is the next element of the list, and the second element is the running total of the operation.Given a
Traversable (x1, x2, x3, x4)
, an initial value ofinit
, an operationop
,foldRight
is defined as:x1 op (x2 op (x3 op (x4 op init)))
- def forallFunctionTraversables(res0: Boolean): Assertion
forall
will determine if a predicate is valid for all members of aTraversable
: - def foreachFunctionTraversables(res0: List[Int]): Assertion
foreach
will apply a function to all elements of aTraversable
, but unlike themap
function, it will not return anything since the return type isUnit
- an equivalent to avoid
return type in Java/C++: - val fullyMatch: FullyMatchWord
- Definition Classes
- MatcherWords
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def groupByFunctionTraversables(res0: Int, res1: Int): Assertion
groupBy
will categorize aTraversable
according to a given function and return a map with the results.groupBy
will categorize aTraversable
according to a given function and return a map with the results. This exercise uses partial function chaining: - def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val have: HaveWord
- Definition Classes
- MatcherWords
- def headFunctionTraversables(res0: Int): Assertion
head
will return the first element of an ordered collection, or some random element if order is not defined like in aSet
orMap
: - def headOptionFunctionTraversables(res0: Option[Int], res1: Option[Int]): Assertion
headOption
will return the first element as anOption
of an ordered collection, or some random element if order is not defined.headOption
will return the first element as anOption
of an ordered collection, or some random element if order is not defined. If a first element is not available, thenNone
is returned: - val ignore: IgnoreWord
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- def inOrder(firstEle: Any, secondEle: Any, remainingEles: Any*)(implicit pos: Position): ResultOfInOrderApplication
- Definition Classes
- Matchers
- def inOrderElementsOf[R](elements: GenTraversable[R]): ResultOfInOrderElementsOfApplication
- Definition Classes
- Matchers
- def inOrderOnly[T](firstEle: Any, secondEle: Any, remainingEles: Any*)(implicit pos: Position): ResultOfInOrderOnlyApplication
- Definition Classes
- Matchers
- val include: IncludeWord
- Definition Classes
- MatcherWords
- def info: Informer
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike → Informing
- def initFunctionTraversables(res0: List[Int]): Assertion
init
will return the rest of the collection without the last: - def intercept[T <: AnyRef](f: => Any)(implicit classTag: ClassTag[T], pos: Position): T
- Definition Classes
- Assertions
- def isEmptyFunctionTraversables(res0: Boolean, res1: Boolean): Assertion
isEmpty
is pretty self-evident: - final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val it: ItWord
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- val key: KeyWord
- Definition Classes
- Matchers
- def knownSizeFunctionTraversables(res0: Int, res1: Int): Assertion
knownSize
will return the number of elements if the traversable has a finite end, otherwise-1
: - def lastFunctionTraversables(res0: Int): Assertion
last
will return the last element of an ordered collection, or some random element if order is not defined: - def lastOptionFunctionTraversables(res0: Option[Int], res1: Option[Int]): Assertion
lastOption
will return the last element as anOption
of an ordered collection, or some random element if order is not defined.lastOption
will return the last element as anOption
of an ordered collection, or some random element if order is not defined. If a last element is not available, thenNone
is returned: - val length: LengthWord
- Definition Classes
- MatcherWords
- def lowPriorityTypeCheckedConstraint[A, B](implicit equivalenceOfB: Equivalence[B], ev: <:<[A, B]): CanEqual[A, B]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- def mapFunctionTraversables(res0: Option[Int]): Assertion
map
will apply the given function on all elements of aTraversable
and return a new collection of the result: - def markup: Documenter
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike → Documenting
- val matchPattern: MatchPatternWord
- Definition Classes
- MatcherWords
- def message(expectedMessage: String): ResultOfMessageWordApplication
- Definition Classes
- Matchers
- def mkStringFunctionIITraversables(res0: String): Assertion
mkString
will also take a beginning and ending string to surround the list.: - def mkStringFunctionTraversables(res0: String): Assertion
mkString
will format aTraversable
using a given string as the delimiter: - final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nestedSuites: IndexedSeq[Suite]
- Definition Classes
- Suite
- def no(xs: String)(implicit collecting: Collecting[Char, String], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Char]
- Definition Classes
- Matchers
- def no[K, V, JMAP[k, v] <: Map[k, v]](xs: JMAP[K, V])(implicit collecting: Collecting[Entry[K, V], JMAP[K, V]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[Entry[K, V]]
- Definition Classes
- Matchers
- def no[E, C[_]](xs: C[E])(implicit collecting: Collecting[E, C[E]], prettifier: Prettifier, pos: Position): ResultOfCollectedAny[E]
- Definition Classes
- Matchers
- def noElementsOf(elements: GenTraversable[Any]): ResultOfNoElementsOfApplication
- Definition Classes
- Matchers
- def noException(implicit pos: Position): NoExceptionWord
- Definition Classes
- MatcherWords
- def nonEmptyFunctionTraversables(res0: Boolean, res1: Boolean): Assertion
nonEmpty
is pretty self-evident too: - def noneOf(firstEle: Any, secondEle: Any, remainingEles: Any*)(implicit pos: Position): ResultOfNoneOfApplication
- Definition Classes
- Matchers
- val not: NotWord
- Definition Classes
- MatcherWords
- def note: Notifier
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike → Notifying
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def of[T](implicit ev: ClassTag[T]): ResultOfOfTypeInvocation[T]
- Definition Classes
- Matchers
- def oneElementOf(elements: GenTraversable[Any]): ResultOfOneElementOfApplication
- Definition Classes
- Matchers
- def oneOf(firstEle: Any, secondEle: Any, remainingEles: Any*)(implicit pos: Position): ResultOfOneOfApplication
- Definition Classes
- Matchers
- def only(xs: Any*)(implicit pos: Position): ResultOfOnlyApplication
- Definition Classes
- Matchers
- def partitionFunctionTraversables(res0: Array[Int], res1: Array[Int]): Assertion
partition
will split aTraversable
according to a predicate, returning a 2 productTuple
.partition
will split aTraversable
according to a predicate, returning a 2 productTuple
. The left-hand side contains the elements satisfied by the predicate whereas the right hand side contains the rest of the elements.partition
is also defined as(xs filter p, xs filterNot p)
- def pending: Assertion with PendingStatement
- Definition Classes
- Assertions
- def pendingUntilFixed(f: => Unit)(implicit pos: Position): Assertion with PendingStatement
- Definition Classes
- Assertions
- val readable: ReadableWord
- Definition Classes
- MatcherWords
- def reduceLeftFunctionTraversables(res0: Int, res1: String): Assertion
reduceLeft
is similar tofoldLeft
, except that the seed is the head value: - def reduceRightAsReduceLeft(res0: Int, res1: Int, res2: Int): Assertion
The naive recursive implementation of
reduceRight
is not tail recursive and would lead to a stack overflow if used on larger traversables.The naive recursive implementation of
reduceRight
is not tail recursive and would lead to a stack overflow if used on larger traversables. However,reduceLeft
can be implemented with tail recursion.To avoid the potential stack overflow with the naive implementation of
reduceRight
we can easily implement it based onreduceLeft
by reverting the list and the inverting the reduce function. The same applies for folding operations.There is also a
reduce
(andfold
) available, which works exactly likereduceLeft
(andfoldLeft
) and it should be the prefered method to call unless there is a strong reason to usereduceRight
(orfoldRight
). - def reduceRightFunctionTraversables(res0: Int, res1: String): Assertion
reduceRight
is similar tofoldRight
, except that the seed is the last value: - val regex: RegexWord
- Definition Classes
- Matchers
- final def registerIgnoredTest(testText: String, testTags: Tag*)(testFun: => Any)(implicit pos: Position): Unit
- Definition Classes
- AnyFlatSpecLike → TestRegistration
- final def registerTest(testText: String, testTags: Tag*)(testFun: => Any)(implicit pos: Position): Unit
- Definition Classes
- AnyFlatSpecLike → TestRegistration
- def rerunner: Option[String]
- Definition Classes
- Suite
- def run(testName: Option[String], args: Args): Status
- Definition Classes
- AnyFlatSpecLike → Suite
- def runNestedSuites(args: Args): Status
- Attributes
- protected
- Definition Classes
- Suite
- def runTest(testName: String, args: Args): Status
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike → TestSuite → Suite
- def runTests(testName: Option[String], args: Args): Status
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike → Suite
- implicit val shorthandSharedTestRegistrationFunction: StringVerbBehaveLikeInvocation
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- implicit val shorthandTestRegistrationFunction: StringVerbStringInvocation
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- val size: SizeWord
- Definition Classes
- MatcherWords
- def sizeFunctionTraversables(res0: Int): Assertion
size
provides the size of the traversable: - def sliceFunctionTraversables(res0: List[Int]): Assertion
Given a
from
index, and ato
index,slice
will return the part of the collection includingfrom
, and excludingto
: - val sorted: SortedWord
- Definition Classes
- MatcherWords
- def spanFunctionTraversables(res0: Array[Int], res1: Array[Int]): Assertion
span
will split aTraversable
according to a predicate, returning a 2 productTuple
.span
will split aTraversable
according to a predicate, returning a 2 productTuple
.span
is also defined as(xs takeWhile p, xs dropWhile p)
- def splitAtFunctionTraversables(res0: Array[Int], res1: Array[Int]): Assertion
splitAt
will split aTraversable
at a position, returning a 2 productTuple
.splitAt
will split aTraversable
at a position, returning a 2 productTuple
.splitAt
is also defined as(xs take n, xs drop n)
- val startWith: StartWithWord
- Definition Classes
- MatcherWords
- final val succeed: Assertion
- Definition Classes
- Assertions
- def suiteId: String
- Definition Classes
- Suite
- def suiteName: String
- Definition Classes
- Suite
- def sumFunctionTraversables(res0: Int, res1: Int, res2: Int, res3: Int): Assertion
There are some methods that take much of the folding work out by providing basic functionality.
There are some methods that take much of the folding work out by providing basic functionality.
sum
will add all the elements,product
will multiply,min
would determine the smallest element, andmax
the largest: - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def tags: Map[String, Set[String]]
- Definition Classes
- AnyFlatSpecLike → Suite
- def tailFunctionTraversables(res0: List[Int]): Assertion
tail
will return the rest of the collection without the head: - def takeFunctionIITraversables(res0: List[Int]): Assertion
take
is used often withLazyList
, since they are alsoTraversable
: - def takeFunctionTraversables(res0: List[Int]): Assertion
take
will return the first number of elements given: - def takeWhileFunctionTraversables(res0: List[Int]): Assertion
takeWhile
will continually accumulate elements until a predicate is no longer satisfied: - def testDataFor(testName: String, theConfigMap: ConfigMap): TestData
- Definition Classes
- AnyFlatSpecLike → Suite
- def testNames: Set[String]
- Definition Classes
- AnyFlatSpecLike → Suite
- def the[T](implicit arg0: ClassTag[T], pos: Position): ResultOfTheTypeInvocation[T]
- Definition Classes
- Matchers
- def theSameElementsAs(xs: GenTraversable[_]): ResultOfTheSameElementsAsApplication
- Definition Classes
- Matchers
- def theSameElementsInOrderAs(xs: GenTraversable[_]): ResultOfTheSameElementsInOrderAsApplication
- Definition Classes
- Matchers
- val theSameInstanceAs: TheSameInstanceAsPhrase
- Definition Classes
- Matchers
- val they: TheyWord
- Attributes
- protected
- Definition Classes
- AnyFlatSpecLike
- def thrownBy(fun: => Any): ResultOfThrownByApplication
- Definition Classes
- Matchers
- def toArrayFunctionTraversables(res0: Boolean): Assertion
toArray
will convert anyTraversable
to anArray
, which is a special wrapper around a primitive Java array: - def toIndexedSeqFunctionTraversables(res0: Boolean): Assertion
toIndexedSeq
will convert anyTraversable
to anIndexedSeq
which is an indexed sequence used inVectors
andStrings
: - def toIterableFunctionTraversables(res0: Boolean): Assertion
toIterable
will convert anyTraversable
to anIterable
.toIterable
will convert anyTraversable
to anIterable
. This is a basetrait
for all Scala collections that define an iterator method to iterate through the collection's elements: - def toLazyListFunctionTraversables(res0: Boolean, res1: LazyList[Int]): Assertion
toStream
will convert anyTraversable
to aLazyList
where elements are evaluated as they are needed: - def toListFunctionIITraversables(res0: Boolean): Assertion
toList
, as well as other conversion methods such astoSet
andtoArray
, will not convert if the collection type is the same: - def toListFunctionTraversables(res0: Boolean): Assertion
toList
will convert anyTraversable
to aList
. - def toMapFunctionIITraversables(res0: Boolean): Assertion
toMap
will also convert aSet
to aMap
; it should be of parameterized typeTuple2
: - def toMapFunctionTraversables(res0: Boolean): Assertion
toMap
will convert anyTraversable
to aMap
.toMap
will convert anyTraversable
to aMap
. How it's used depends on the original collection; if it's aList
orSeq
, it should be of parameterized typeTuple2
: - def toSeqFunctionTraversables(res0: Boolean): Assertion
toSeq
will convert anyTraversable
to aSeq
which is an orderedIterable
and the superclass toList
,Queue
, andVector
.toSeq
will convert anyTraversable
to aSeq
which is an orderedIterable
and the superclass toList
,Queue
, andVector
.Sequences
provide a method apply for indexing. Indices range from 0 up to the length of a sequence: - def toSetFunctionTraversables(res0: Boolean): Assertion
toSet
will convert anyTraversable
to aSet
which is a collection of unordered, unique values: - def toString(): String
- Definition Classes
- AnyFlatSpec → AnyRef → Any
- def topOfCollectionTraversables(res0: Int, res1: Int): Assertion
At the top of the collection hierarchy is the trait
Traversable
.At the top of the collection hierarchy is the trait
Traversable
. Its only abstract operation isforeach
:def foreach[U](f: Elem => U)
Collection classes that implement
Traversable
just need to define this method; all other methods can be inherited fromTraversable
.The
foreach
method is meant to traverse all elements of the collection, and apply the given operation,f
, to each element. The type of the operation isElem => U
, whereElem
is the type of the collection's elements andU
is an arbitrary result type. The invocation off
is done for its side effect only; in fact any function result off
is discarded byforeach
.Traversables are the superclass of
List
,Array
,Map
,Set
,Stream
and more. The methods involved can be applied to each other in a different type.++
appends twoTraversable
s together. The resultingTraversable
is the same type of the first element. - def transposeFunctionTraversables(res0: List[Int], res1: List[Int], res2: List[Int], res3: List[Int]): Assertion
transpose
will take a traversable of traversables and group them by their position in it's own traversable, e.g.:((x1, x2),(y1, y2)).transpose = (x1, y1), (x2, y2)
or((x1, x2, x3),(y1, y2, y3),(z1, z2, z3)).transpose = ((x1, y1, z1), (x2, y2, z2), (x3, y3, z3))
- val typeCheck: TypeCheckWord
- Definition Classes
- MatcherWords
- def typeCheckedConstraint[A, B](implicit equivalenceOfA: Equivalence[A], ev: <:<[B, A]): CanEqual[A, B]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- implicit def unconstrainedEquality[A, B](implicit equalityOfA: Equality[A]): CanEqual[A, B]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- val value: ValueWord
- Definition Classes
- Matchers
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def withClue[T](clue: Any)(fun: => T): T
- Definition Classes
- Assertions
- def withFixture(test: NoArgTest): Outcome
- Attributes
- protected
- Definition Classes
- TestSuite
- val writable: WritableWord
- Definition Classes
- MatcherWords
Deprecated Value Members
- def conversionCheckedConstraint[A, B](implicit equivalenceOfA: Equivalence[A], cnv: (B) => A): CanEqual[A, B]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- Annotations
- @deprecated
- Deprecated
(Since version 3.1.0) The conversionCheckedConstraint method has been deprecated and will be removed in a future version of ScalaTest. It is no longer needed now that the deprecation period of ConversionCheckedTripleEquals has expired. It will not be replaced.
- def convertEquivalenceToAToBConversionConstraint[A, B](equivalenceOfB: Equivalence[B])(implicit ev: (A) => B): CanEqual[A, B]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- Annotations
- @deprecated
- Deprecated
(Since version 3.1.0) The convertEquivalenceToAToBConversionConstraint method has been deprecated and will be removed in a future version of ScalaTest. It is no longer needed now that the deprecation period of ConversionCheckedTripleEquals has expired. It will not be replaced.
- def convertEquivalenceToBToAConversionConstraint[A, B](equivalenceOfA: Equivalence[A])(implicit ev: (B) => A): CanEqual[A, B]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- Annotations
- @deprecated
- Deprecated
(Since version 3.1.0) The convertEquivalenceToBToAConversionConstraint method has been deprecated and will be removed in a future version of ScalaTest. It is no longer needed now that the deprecation period of ConversionCheckedTripleEquals has expired. It will not be replaced.
- def lowPriorityConversionCheckedConstraint[A, B](implicit equivalenceOfB: Equivalence[B], cnv: (A) => B): CanEqual[A, B]
- Definition Classes
- TripleEquals → TripleEqualsSupport
- Annotations
- @deprecated
- Deprecated
(Since version 3.1.0) The lowPriorityConversionCheckedConstraint method has been deprecated and will be removed in a future version of ScalaTest. It is no longer needed now that the deprecation period of ConversionCheckedTripleEquals has expired. It will not be replaced.
- final val styleName: String
- Definition Classes
- AnyFlatSpecLike → Suite
- Annotations
- @deprecated
- Deprecated
(Since version 3.1.0) The styleName lifecycle method has been deprecated and will be removed in a future version of ScalaTest with no replacement.