final defasInstanceOf[T0]: T0

Definition Classes

Any

defassert(o: Option[String]): Unit

Assert that an Option[String] is None.

Assert that an Option[String] is None.
If the condition is None, this method returns normally.
Else, it throws TestFailedException with the String
value of the Some included in the TestFailedException's
detail message.

This form of assert is usually called in conjunction with an
implicit conversion to Equalizer, using a === comparison, as in:

defassert(o: Option[String], clue: Any): Unit

Assert that an Option[String] is None.

Assert that an Option[String] is None.
If the condition is None, this method returns normally.
Else, it throws TestFailedException with the String
value of the Some, as well as the
String obtained by invoking toString on the
specified message,
included in the TestFailedException's detail message.

This form of assert is usually called in conjunction with an
implicit conversion to Equalizer, using a === comparison, as in:

defassert(condition: Boolean, clue: Any): Unit

Assert that a boolean condition, described in Stringmessage, is true.

Assert that a boolean condition, described in Stringmessage, is true.
If the condition is true, this method returns normally.
Else, it throws TestFailedException with the
String obtained by invoking toString on the
specified message as the exception's detail message.

condition

the boolean condition to assert

clue

An objects whose toString method returns a message to include in a failure report.

Because trait Suite mixes in Assertions, this implicit conversion will always be
available by default in ScalaTest Suites. This is the only implicit conversion that is in scope by default in every
ScalaTest Suite. Other implicit conversions offered by ScalaTest, such as those that support the matchers DSL
or invokePrivate, must be explicitly invited into your test code, either by mixing in a trait or importing the
members of its companion object. The reason ScalaTest requires you to invite in implicit conversions (with the exception of the
implicit conversion for === operator) is because if one of ScalaTest's implicit conversions clashes with an
implicit conversion used in the code you are trying to test, your program won't compile. Thus there is a chance that if you
are ever trying to use a library or test some code that also offers an implicit conversion involving a === operator,
you could run into the problem of a compiler error due to an ambiguous implicit conversion. If that happens, you can turn off
the implicit conversion offered by this convertToEqualizer method simply by overriding the method in your
Suite subclass, but not marking it as implicit:

final defeq(arg0: AnyRef): Boolean

The left should 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:

defexpectResult(expected: Any, clue: Any)(actual: Any): Unit

Expect that the value passed as expected equals the value passed as actual.

Expect that the value passed as expected equals the value passed as actual.
If the actual equals the expected
(as determined by ==), expectResult returns
normally. Else, if actual is not equal to expected, expectResult throws a
TestFailedException whose detail message includes the expected and actual values, as well as the String
obtained by invoking toString on the passed clue.

expected

the expected value

clue

An object whose toString method returns a message to include in a failure report.

Intercept and return an exception that's expected to
be thrown by the passed function value.

Intercept and return an exception that's expected to
be thrown by the passed function value. The thrown exception must be an instance of the
type specified by the type parameter of this method. This method invokes the passed
function. If the function throws an exception that's an instance of the specified type,
this method returns that exception. Else, whether the passed function returns normally
or completes abruptly with a different exception, this method throws TestFailedException.

Note that the type specified as this method's type parameter may represent any subtype of
AnyRef, not just Throwable or one of its subclasses. In
Scala, exceptions can be caught based on traits they implement, so it may at times make sense
to specify a trait that the intercepted exception's class must mix in. If a class instance is
passed for a type that could not possibly be used to catch an exception (such as String,
for example), this method will complete abruptly with a TestFailedException.

f

the function value that should throw the expected exception

manifest

an implicit Manifest representing the type of the specified
type parameter.

final defwait(): Unit

final defwait(arg0: Long, arg1: Int): Unit

Definition Classes

AnyRef

Annotations

@throws()

final defwait(arg0: Long): Unit

Definition Classes

AnyRef

Annotations

@throws()

defwithClue[T](clue: Any)(fun: ⇒ T): T

Executes the block of code passed as the second parameter, and, if it
completes abruptly with a ModifiableMessage exception,
prepends the "clue" string passed as the first parameter to the beginning of the detail message
of that thrown exception, then rethrows it.

Executes the block of code passed as the second parameter, and, if it
completes abruptly with a ModifiableMessage exception,
prepends the "clue" string passed as the first parameter to the beginning of the detail message
of that thrown exception, then rethrows it. If clue does not end in a white space
character, one space will be added
between it and the existing detail message (unless the detail message is
not defined).

This method allows you to add more information about what went wrong that will be
reported when a test fails. Here's an example: