org.scalatest.junit

ShouldMatchersForJUnit

trait ShouldMatchersForJUnit extends matchers.ShouldMatchers with AssertionsForJUnit

Trait that makes ScalaTest's ShouldMatchers DSL syntax available for use with JUnit.

The assertion methods provided in this trait look and behave exactly like the ones in ShouldMatchers, except instead of throwing TestFailedException they throw JUnitTestFailedError, which extends junit.framework.AssertionFailedError.

JUnit 3 (release 3.8 and earlier) distinguishes between failures and errors. If a test fails because of a failed assertion, that is considered a failure. If a test fails for any other reason, either the test code or the application being tested threw an unexpected exception, that is considered an error. The way JUnit 3 decides whether an exception represents a failure or error is that only thrown junit.framework.AssertionFailedErrors are considered failures. Any other exception type is considered an error. The exception type thrown by the JUnit 3 assertion methods declared in junit.framework.Assert (such as assertEquals, assertTrue, and fail) is, therefore, AssertionFailedError.

In JUnit 4, AssertionFailedError was made to extend java.lang.AssertionError, and the distinction between failures and errors was essentially dropped. However, some tools that integrate with JUnit carry on this distinction, so even if you are using JUnit 4 you may want to use this ShouldMatchersForJUnit trait instead of plain-old ScalaTest ShouldMatchers.

To use this trait in a JUnit 3 TestCase, you can mix it into your TestCase class, like this:

import junit.framework.TestCase
import org.scalatest.junit.ShouldMatchersForJUnit

class MyTestCase extends TestCase with ShouldMatchersForJUnit {

def testSomething() { "hello, world!" should startWith ("hello") }

// ... }

You can alternatively import the methods defined in this trait.

import junit.framework.TestCase
import org.scalatest.junit.ShouldMatchersForJUnit._

class MyTestCase extends TestCase {

def testSomething() { "hello, world!" should startWith ("hello") }

// ... }

For details on the importing approach, see the documentation for the ShouldMatchersForJUnit companion object. For the details on the ShouldMatchersForJUnit syntax, see the Scaladoc documentation for org.scalatest.matchers.ShouldMatchers

Annotations
@deprecated
Deprecated

Please use org.scalatest.Matchers with AssertionsForJUnit instead.

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ShouldMatchersForJUnit
  2. AssertionsForJUnit
  3. ShouldMatchers
  4. Matchers
  5. Explicitly
  6. MatcherWords
  7. LoneElement
  8. ShouldVerb
  9. Tolerance
  10. Assertions
  11. LegacyTripleEquals
  12. EqualityConstraints
  13. AnyRef
  14. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. final class AWord extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  2. final class AnWord extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  3. class AnyShouldWrapper[T] extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  4. final class ArrayShouldWrapper[E] extends AnyShouldWrapper[Array[E]]

    This class is part of the ScalaTest matchers DSL.

  5. trait ContainMethods[T] extends AnyRef

    Definition Classes
    Matchers
  6. class DecidedWord extends AnyRef

    Definition Classes
    Explicitly
  7. final class HavePropertyMatcherGenerator extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  8. final class JavaCollectionShouldWrapper[E, L[_] <: Collection[_]] extends AnyShouldWrapper[L[E]]

    This class is part of the ScalaTest matchers DSL.

  9. final class JavaMapShouldWrapper[K, V, L[_, _] <: Map[_, _]] extends AnyShouldWrapper[L[K, V]]

    This class is part of the ScalaTest matchers DSL.

  10. final class KeyWord extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  11. final class LoneElementTraversableWrapper[T] extends AnyRef

    Definition Classes
    LoneElement
  12. final class MapShouldWrapper[K, V, L[_, _] <: GenMap[_, _]] extends AnyShouldWrapper[L[K, V]]

    This class is part of the ScalaTest matchers DSL.

  13. final class PlusOrMinusWrapper[T] extends AnyRef

    Wrapper class with a +- method that, given a Numeric argument, returns an Interval.

  14. final class RegexWord extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  15. final class RegexWrapper extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  16. class ResultOfBeWordForAny[T] extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  17. sealed class ResultOfBeWordForCollectedAny[T] extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  18. final class ResultOfBeWordForCollectedArray[T] extends ResultOfBeWordForCollectedAny[Array[T]]

    This class is part of the ScalaTest matchers DSL.

  19. sealed class ResultOfCollectedAny[T] extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  20. final class ResultOfCollectedArray[T] extends ResultOfCollectedAny[Array[T]]

    This class is part of the ScalaTest matchers DSL.

  21. final class ResultOfCollectedGenMap[K, V] extends ResultOfCollectedAny[GenMap[K, V]]

    This class is part of the ScalaTest matchers DSL.

  22. final class ResultOfCollectedGenTraversable[E, C[_] <: GenTraversable[_]] extends ResultOfCollectedAny[C[E]]

    This class is part of the ScalaTest matchers DSL.

  23. final class ResultOfCollectedString extends ResultOfCollectedAny[String]

    This class is part of the ScalaTest matchers DSL.

  24. final class ResultOfContainWordForCollectedArray[T] extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  25. final class ResultOfContainWordForCollectedGenMap[K, V] extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  26. final class ResultOfContainWordForCollectedGenTraversable[E, C[_] <: GenTraversable[_]] extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  27. final class ResultOfContainWordForJavaCollection[E, L[_] <: Collection[_]] extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  28. final class ResultOfContainWordForJavaMap[K, V] extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  29. final class ResultOfContainWordForMap[K, V] extends ContainMethods[(K, V)]

    This class is part of the ScalaTest matchers DSL.

  30. class ResultOfContainWordForTraversable[E] extends ContainMethods[E]

    This class is part of the ScalaTest matchers DSL.

  31. final class ResultOfElementWordApplication[T] extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  32. final class ResultOfEndWithWordForCollectedString extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  33. final class ResultOfEndWithWordForString extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  34. final class ResultOfEvaluatingApplication extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  35. final class ResultOfFullyMatchWordForCollectedString extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  36. final class ResultOfFullyMatchWordForString extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  37. final class ResultOfHaveWordForCollectedExtent[A] extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  38. final class ResultOfHaveWordForExtent[A] extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  39. final class ResultOfIncludeWordForCollectedString extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  40. final class ResultOfIncludeWordForString extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  41. class ResultOfNewContainWord[L] extends AnyRef

    Definition Classes
    Matchers
  42. sealed class ResultOfNotWordForCollectedAny[T] extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  43. sealed class ResultOfNotWordForCollectedArray[E, T <: Array[E]] extends ResultOfNotWordForCollectedAny[T]

    This class is part of the ScalaTest matchers DSL.

  44. final class ResultOfNotWordForCollectedGenMap[K, V, T <: GenMap[K, V]] extends ResultOfNotWordForCollectedAny[T]

    This class is part of the ScalaTest matchers DSL.

  45. sealed class ResultOfNotWordForCollectedGenTraversable[E, C[_] <: GenTraversable[_]] extends ResultOfNotWordForCollectedAny[C[E]]

    This class is part of the ScalaTest matchers DSL.

  46. final class ResultOfNotWordForCollectedString extends ResultOfNotWordForCollectedAny[String]

    This class is part of the ScalaTest matchers DSL.

  47. final class ResultOfProduceInvocation[T] extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  48. final class ResultOfStartWithWordForCollectedString extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  49. final class ResultOfStartWithWordForString extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  50. final class StringShouldWrapper extends AnyShouldWrapper[String] with StringShouldWrapperForVerb

    This class is part of the ScalaTest matchers DSL.

  51. trait StringShouldWrapperForVerb extends AnyRef

    This class supports the syntax of FlatSpec, WordSpec, fixture.FlatSpec, and fixture.WordSpec.

  52. class TheAfterWord extends AnyRef

    Definition Classes
    Explicitly
  53. final class TheSameInstanceAsPhrase extends AnyRef

    This class is part of the ScalaTest matchers DSL.

  54. class TraversableShouldWrapper[E, L[_] <: GenTraversable[_]] extends AnyShouldWrapper[L[E]]

    This class is part of the ScalaTest matchers DSL.

  55. final class ValueWord extends AnyRef

    This class is part of the ScalaTest matchers DSL.

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. def !==[T](right: Interval[T]): TripleEqualsInvocationOnInterval[T]

    Returns a TripleEqualsInvocationOnInterval[T], given an Interval[T], to facilitate the “<left> should !== (<pivot> +- <tolerance>)” syntax of Matchers.

    Returns a TripleEqualsInvocationOnInterval[T], given an Interval[T], to facilitate the “<left> should !== (<pivot> +- <tolerance>)” syntax of Matchers.

    right

    the Interval[T] against which to compare the left-hand value

    returns

    a TripleEqualsInvocationOnInterval wrapping the passed Interval[T] value, with expectingEqual set to false.

    Definition Classes
    EqualityConstraints
  4. def !==(right: Null): TripleEqualsInvocation[Null]

    Returns a TripleEqualsInvocation[Null], given a null reference, to facilitate the “<left> should !== null” syntax of Matchers.

    Returns a TripleEqualsInvocation[Null], given a null reference, to facilitate the “<left> should !== null” syntax of Matchers.

    right

    a null reference

    returns

    a TripleEqualsInvocation wrapping the passed null value, with expectingEqual set to false.

    Definition Classes
    EqualityConstraints
  5. def !==[T](right: T): TripleEqualsInvocation[T]

    Returns a TripleEqualsInvocation[T], given an object of type T, to facilitate the “<left> should !== <right>” syntax of Matchers.

    Returns a TripleEqualsInvocation[T], given an object of type T, to facilitate the “<left> should !== <right>” syntax of Matchers.

    right

    the right-hand side value for an equality assertion

    returns

    a TripleEqualsInvocation wrapping the passed right value, with expectingEqual set to false.

    Definition Classes
    EqualityConstraints
  6. final def ##(): Int

    Definition Classes
    AnyRef → Any
  7. def <[T](right: T)(implicit arg0: (T) ⇒ Ordered[T]): ResultOfLessThanComparison[T]

    This method enables the following syntax:

    This method enables the following syntax:

    num should (not be < (10) and not be > (17))
                       ^
    

    Definition Classes
    Matchers
  8. def <=[T](right: T)(implicit arg0: (T) ⇒ Ordered[T]): ResultOfLessThanOrEqualToComparison[T]

    This method enables the following syntax:

    This method enables the following syntax:

    num should (not be <= (10) and not be > (17))
                       ^
    

    Definition Classes
    Matchers
  9. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  11. def ===[T](right: Interval[T]): TripleEqualsInvocationOnInterval[T]

    Returns a TripleEqualsInvocationOnInterval[T], given an Interval[T], to facilitate the “<left> should === (<pivot> +- <tolerance>)” syntax of Matchers.

    Returns a TripleEqualsInvocationOnInterval[T], given an Interval[T], to facilitate the “<left> should === (<pivot> +- <tolerance>)” syntax of Matchers.

    right

    the Interval[T] against which to compare the left-hand value

    returns

    a TripleEqualsInvocationOnInterval wrapping the passed Interval[T] value, with expectingEqual set to true.

    Definition Classes
    EqualityConstraints
  12. def ===(right: Null): TripleEqualsInvocation[Null]

    Returns a TripleEqualsInvocation[Null], given a null reference, to facilitate the “<left> should === null” syntax of Matchers.

    Returns a TripleEqualsInvocation[Null], given a null reference, to facilitate the “<left> should === null” syntax of Matchers.

    right

    a null reference

    returns

    a TripleEqualsInvocation wrapping the passed null value, with expectingEqual set to true.

    Definition Classes
    EqualityConstraints
  13. def ===[T](right: T): TripleEqualsInvocation[T]

    Returns a TripleEqualsInvocation[T], given an object of type T, to facilitate the “<left> should === <right>” syntax of Matchers.

    Returns a TripleEqualsInvocation[T], given an object of type T, to facilitate the “<left> should === <right>” syntax of Matchers.

    right

    the right-hand side value for an equality assertion

    returns

    a TripleEqualsInvocation wrapping the passed right value, with expectingEqual set to true.

    Definition Classes
    EqualityConstraints
  14. def >[T](right: T)(implicit arg0: (T) ⇒ Ordered[T]): ResultOfGreaterThanComparison[T]

    This method enables the following syntax:

    This method enables the following syntax:

    num should (not be > (10) and not be < (7))
                       ^
    

    Definition Classes
    Matchers
  15. def >=[T](right: T)(implicit arg0: (T) ⇒ Ordered[T]): ResultOfGreaterThanOrEqualToComparison[T]

    This method enables the following syntax:

    This method enables the following syntax:

    num should (not be >= (10) and not be < (7))
                       ^
    

    Definition Classes
    Matchers
  16. val a: AWord

    This field enables the following syntax:

    This field enables the following syntax:

    badBook should not be a ('goodRead)
                          ^
    

    Definition Classes
    Matchers
  17. val after: TheAfterWord

    Definition Classes
    Explicitly
  18. def all[K, V](xs: GenTraversable[GenMap[K, V]]): ResultOfCollectedGenMap[K, V]

    Definition Classes
    Matchers
  19. def all[T](xs: GenTraversable[Array[T]]): ResultOfCollectedArray[T]

    Definition Classes
    Matchers
  20. def all[E, C[_] <: GenTraversable[_]](xs: GenTraversable[C[E]]): ResultOfCollectedGenTraversable[E, C]

    Definition Classes
    Matchers
  21. def all(xs: GenTraversable[String]): ResultOfCollectedString

    Definition Classes
    Matchers
  22. def all[T](xs: GenTraversable[T]): ResultOfCollectedAny[T]

    Definition Classes
    Matchers
  23. def allOf[T](xs: T*)(implicit equality: Equality[T]): AllOfContainMatcher[T]

    This method enables the following syntax:

    This method enables the following syntax:

    List(1, 2, 3) should contain (allOf(1, 2))
                                  ^
    

    Definition Classes
    Matchers
  24. val an: AnWord

    This field enables the following syntax:

    This field enables the following syntax:

    badBook should not be an (excellentRead)
                          ^
    

    Definition Classes
    Matchers
  25. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  26. def assert(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:

    assert(a === b)
    

    For more information on how this mechanism works, see the documentation for Equalizer.

    o

    the Option[String] to assert

    Definition Classes
    Assertions
    Exceptions thrown
    TestFailedException

    if the Option[String] is Some.

  27. def assert(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 clue, 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:

    assert(a === b, "extra info reported if assertion fails")
    

    For more information on how this mechanism works, see the documentation for Equalizer.

    o

    the Option[String] to assert

    clue

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

    Definition Classes
    Assertions
    Exceptions thrown
    NullPointerException

    if message is null.

    TestFailedException

    if the Option[String] is Some.

  28. def assert(condition: Boolean, clue: Any): Unit

    Assert that a boolean condition, described in String message, is true.

    Assert that a boolean condition, described in String message, 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 clue 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.

    Definition Classes
    Assertions
    Exceptions thrown
    NullPointerException

    if message is null.

    TestFailedException

    if the condition is false.

  29. def assert(condition: Boolean): Unit

    Assert that a boolean condition is true.

    Assert that a boolean condition is true. If the condition is true, this method returns normally. Else, it throws TestFailedException.

    condition

    the boolean condition to assert

    Definition Classes
    Assertions
    Exceptions thrown
    TestFailedException

    if the condition is false.

  30. def assertResult(expected: Any)(actual: Any): Unit

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

    Assert that the value passed as expected equals the value passed as actual. If the actual value equals the expected value (as determined by ==), assertResult returns normally. Else, assertResult throws a TestFailedException whose detail message includes the expected and actual values.

    expected

    the expected value

    actual

    the actual value, which should equal the passed expected value

    Definition Classes
    Assertions
    Exceptions thrown
    TestFailedException

    if the passed actual value does not equal the passed expected value.

  31. def assertResult(expected: Any, clue: Any)(actual: Any): Unit

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

    Assert that the value passed as expected equals the value passed as actual. If the actual equals the expected (as determined by ==), assertResult returns normally. Else, if actual is not equal to expected, assertResult 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.

    actual

    the actual value, which should equal the passed expected value

    Definition Classes
    Assertions
    Exceptions thrown
    TestFailedException

    if the passed actual value does not equal the passed expected value.

  32. def assume(o: Option[String]): Unit

    Assume that an Option[String] is None.

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

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

    assert(a === b)
    

    For more information on how this mechanism works, see the documentation for Equalizer.

    o

    the Option[String] to assert

    Definition Classes
    Assertions
    Exceptions thrown
    TestFailedException

    if the Option[String] is Some.

  33. def assume(o: Option[String], clue: Any): Unit

    Assume that an Option[String] is None.

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

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

    assume(a === b, "extra info reported if assertion fails")
    

    For more information on how this mechanism works, see the documentation for Equalizer.

    o

    the Option[String] to assert

    clue

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

    Definition Classes
    Assertions
    Exceptions thrown
    NullPointerException

    if message is null.

    TestCanceledException

    if the Option[String] is Some.

  34. def assume(condition: Boolean, clue: Any): Unit

    Assume that a boolean condition, described in String message, is true.

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

    condition

    the boolean condition to assume

    clue

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

    Definition Classes
    Assertions
    Exceptions thrown
    NullPointerException

    if message is null.

    TestFailedException

    if the condition is false.

  35. def assume(condition: Boolean): Unit

    Assume that a boolean condition is true.

    Assume that a boolean condition is true. If the condition is true, this method returns normally. Else, it throws TestCanceledException.

    condition

    the boolean condition to assert

    Definition Classes
    Assertions
    Exceptions thrown
    TestCanceledException

    if the condition is false.

  36. def atLeast[K, V](num: Int, xs: GenTraversable[GenMap[K, V]]): ResultOfCollectedGenMap[K, V]

    Definition Classes
    Matchers
  37. def atLeast[T](num: Int, xs: GenTraversable[Array[T]]): ResultOfCollectedArray[T]

    Definition Classes
    Matchers
  38. def atLeast[E, C[_] <: GenTraversable[_]](num: Int, xs: GenTraversable[C[E]]): ResultOfCollectedGenTraversable[E, C]

    Definition Classes
    Matchers
  39. def atLeast(num: Int, xs: GenTraversable[String]): ResultOfCollectedString

    Definition Classes
    Matchers
  40. def atLeast[T](num: Int, xs: GenTraversable[T]): ResultOfCollectedAny[T]

    Definition Classes
    Matchers
  41. def atMost[K, V](num: Int, xs: GenTraversable[GenMap[K, V]]): ResultOfCollectedGenMap[K, V]

    Definition Classes
    Matchers
  42. def atMost[T](num: Int, xs: GenTraversable[Array[T]]): ResultOfCollectedArray[T]

    Definition Classes
    Matchers
  43. def atMost[E, C[_] <: GenTraversable[_]](num: Int, xs: GenTraversable[C[E]]): ResultOfCollectedGenTraversable[E, C]

    Definition Classes
    Matchers
  44. def atMost(num: Int, xs: GenTraversable[String]): ResultOfCollectedString

    Definition Classes
    Matchers
  45. def atMost[T](num: Int, xs: GenTraversable[T]): ResultOfCollectedAny[T]

    Definition Classes
    Matchers
  46. val be: BeWord

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    obj should (be theSameInstanceAs (string) and be theSameInstanceAs (string))
                ^
    

    Definition Classes
    MatcherWords
  47. def between[K, V](from: Int, upTo: Int, xs: GenTraversable[GenMap[K, V]]): ResultOfCollectedGenMap[K, V]

    Definition Classes
    Matchers
  48. def between[T](from: Int, upTo: Int, xs: GenTraversable[Array[T]]): ResultOfCollectedArray[T]

    Definition Classes
    Matchers
  49. def between[E, C[_] <: GenTraversable[_]](from: Int, upTo: Int, xs: GenTraversable[C[E]]): ResultOfCollectedGenTraversable[E, C]

    Definition Classes
    Matchers
  50. def between(from: Int, upTo: Int, xs: GenTraversable[String]): ResultOfCollectedString

    Definition Classes
    Matchers
  51. def between[T](from: Int, upTo: Int, xs: GenTraversable[T]): ResultOfCollectedAny[T]

    Definition Classes
    Matchers
  52. def cancel(cause: Throwable): Nothing

    Throws TestCanceledException, with the passed Throwable cause, to indicate a test failed.

    Throws TestCanceledException, with the passed Throwable cause, to indicate a test failed. The getMessage method of the thrown TestCanceledException will return cause.toString.

    cause

    a Throwable that indicates the cause of the cancellation.

    Definition Classes
    Assertions
    Exceptions thrown
    NullPointerException

    if cause is null

  53. def cancel(message: String, cause: Throwable): Nothing

    Throws TestCanceledException, with the passed String message as the exception's detail message and Throwable cause, to indicate a test failed.

    Throws TestCanceledException, with the passed String message as the exception's detail message and Throwable cause, to indicate a test failed.

    message

    A message describing the failure.

    cause

    A Throwable that indicates the cause of the failure.

    Definition Classes
    Assertions
    Exceptions thrown
    NullPointerException

    if message or cause is null

  54. def cancel(message: String): Nothing

    Throws TestCanceledException, with the passed String message as the exception's detail message, to indicate a test was canceled.

    Throws TestCanceledException, with the passed String message as the exception's detail message, to indicate a test was canceled.

    message

    A message describing the cancellation.

    Definition Classes
    Assertions
    Exceptions thrown
    NullPointerException

    if message is null

  55. def cancel(): Nothing

    Throws TestCanceledException to indicate a test was canceled.

    Throws TestCanceledException to indicate a test was canceled.

    Definition Classes
    Assertions
  56. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  57. val contain: ContainWord

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    list should (contain ('a') and have length (7))
                 ^
    

    Definition Classes
    MatcherWords
  58. def conversionCheckedEqualityConstraint[A, B](implicit equalityOfA: Equality[A], cnv: (B) ⇒ A): EqualityConstraint[A, B]

    Provides an EqualityConstraint[A, B] class for any two types A and B, enforcing the type constraint that B is implicitly convertible to A, given an implicit Equality[A].

    Provides an EqualityConstraint[A, B] class for any two types A and B, enforcing the type constraint that B is implicitly convertible to A, given an implicit Equality[A].

    The implicitly passed Equality[A] must be used to determine equality by the returned EqualityConstraint's areEqual method.

    This method is overridden and made implicit by subtraits ConversionCheckedTripleEquals) and ConversionCheckedLegacyTripleEquals, and overriden as non-implicit by the other subtraits in this package.

    equalityOfA

    an Equality[A] type class to which the EqualityConstraint.areEqual method will delegate to determine equality.

    cnv

    an implicit conversion from B to A

    returns

    an EqualityConstraint[A, B] whose areEqual method delegates to the areEqual method of the passed Equality[A].

    Definition Classes
    LegacyTripleEqualsEqualityConstraints
  59. implicit def convertMapMatcherToJavaMapMatcher[K, V](mapMatcher: Matcher[GenMap[K, V]]): Matcher[Map[K, V]]

    This implicit conversion method enables the following syntax (javaMap is a java.util.Map):

    This implicit conversion method enables the following syntax (javaMap is a java.util.Map):

    javaMap should (contain key ("two"))
    

    The (contain key ("two")) expression will result in a Matcher[scala.collection.GenMap[String, Any]]. This implicit conversion method will convert that matcher to a Matcher[java.util.Map[String, Any]].

    Definition Classes
    Matchers
  60. implicit def convertNumericToPlusOrMinusWrapper[T](pivot: T)(implicit arg0: Numeric[T]): PlusOrMinusWrapper[T]

    Implicitly converts an object of a Numeric type to a PlusOrMinusWrapper, to enable a +- method to be invoked on that object.

    Implicitly converts an object of a Numeric type to a PlusOrMinusWrapper, to enable a +- method to be invoked on that object.

    Definition Classes
    Tolerance
  61. implicit def convertSymbolToHavePropertyMatcherGenerator(symbol: Symbol): HavePropertyMatcherGenerator

    This implicit conversion method converts a Symbol to a HavePropertyMatcherGenerator, to enable the symbol to be used with the have ('author ("Dickens")) syntax.

    This implicit conversion method converts a Symbol to a HavePropertyMatcherGenerator, to enable the symbol to be used with the have ('author ("Dickens")) syntax.

    Definition Classes
    Matchers
  62. implicit def convertToAnyShouldWrapper[T](o: T): AnyShouldWrapper[T]

    Implicitly converts an object of type T to a AnyShouldWrapper[T], to enable should methods to be invokable on that object.

    Implicitly converts an object of type T to a AnyShouldWrapper[T], to enable should methods to be invokable on that object.

    Definition Classes
    Matchers
  63. implicit def convertToArrayShouldWrapper[T](o: Array[T]): ArrayShouldWrapper[T]

    Implicitly converts an object of type scala.Array[T] to a ArrayShouldWrapper[T], to enable should methods to be invokable on that object.

    Implicitly converts an object of type scala.Array[T] to a ArrayShouldWrapper[T], to enable should methods to be invokable on that object.

    Definition Classes
    Matchers
  64. def convertToCheckingEqualizer[T](left: T): CheckingEqualizer[T]

    Convert to an CheckingEqualizer that provides === and !== operators that result in Boolean and enforce a type constraint.

    Convert to an CheckingEqualizer that provides === and !== operators that result in Boolean and enforce a type constraint.

    This method is overridden and made implicit by subtraits TypeCheckedTripleEquals and ConversionCheckedTripleEquals, and overriden as non-implicit by the other subtraits in this package.

    left

    the object whose type to convert to CheckingEqualizer.

    Definition Classes
    LegacyTripleEqualsEqualityConstraints
    Exceptions thrown
    NullPointerException

    if left is null.

  65. def convertToEqualizer[T](left: T): Equalizer[T]

    Convert to an Equalizer that provides === and !== operators that result in Boolean and enforce no type constraint.

    Convert to an Equalizer that provides === and !== operators that result in Boolean and enforce no type constraint.

    This method is overridden and made implicit by subtrait TripleEquals and overriden as non-implicit by the other subtraits in this package.

    left

    the object whose type to convert to Equalizer.

    Definition Classes
    LegacyTripleEqualsEqualityConstraints
    Exceptions thrown
    NullPointerException

    if left is null.

  66. implicit def convertToJavaCollectionShouldWrapper[E, L[_] <: Collection[_]](o: L[E]): JavaCollectionShouldWrapper[E, L]

    Implicitly converts an object of type java.util.Collection[T] to a JavaCollectionShouldWrapper[T], to enable should methods to be invokable on that object.

    Implicitly converts an object of type java.util.Collection[T] to a JavaCollectionShouldWrapper[T], to enable should methods to be invokable on that object.

    Definition Classes
    Matchers
  67. implicit def convertToJavaMapShouldWrapper[K, V, L[_, _] <: Map[_, _]](o: L[K, V]): JavaMapShouldWrapper[K, V, L]

    Implicitly converts an object of type java.util.Map[K, V] to a JavaMapShouldWrapper[K, V], to enable should methods to be invokable on that object.

    Implicitly converts an object of type java.util.Map[K, V] to a JavaMapShouldWrapper[K, V], to enable should methods to be invokable on that object.

    Definition Classes
    Matchers
  68. def convertToLegacyCheckingEqualizer[T](left: T): LegacyCheckingEqualizer[T]

    Convert to a LegacyCheckingEqualizer that provides === and !== operators that result in Option[String] and enforce a type constraint.

    Convert to a LegacyCheckingEqualizer that provides === and !== operators that result in Option[String] and enforce a type constraint.

    This method is overridden and made implicit by subtraits TypeCheckedLegacyTripleEquals and ConversionCheckedLegacyTripleEquals, and overriden as non-implicit by the other subtraits in this package.

    left

    the object whose type to convert to LegacyCheckingEqualizer.

    Definition Classes
    LegacyTripleEqualsEqualityConstraints
    Exceptions thrown
    NullPointerException

    if left is null.

  69. implicit def convertToLegacyEqualizer[T](left: T): LegacyEqualizer[T]

    Convert to a LegacyEqualizer that provides === and !== operators that result in Option[String] and enforce no type constraint.

    Convert to a LegacyEqualizer that provides === and !== operators that result in Option[String] and enforce no type constraint.

    This method is overridden and made implicit by subtrait LegacyTripleEquals and overriden as non-implicit by the other subtraits in this package.

    left

    the object whose type to convert to LegacyEqualizer.

    Definition Classes
    LegacyTripleEqualsEqualityConstraints
    Exceptions thrown
    NullPointerException

    if left is null.

  70. implicit def convertToMapShouldWrapper[K, V, L[_, _] <: GenMap[_, _]](o: L[K, V]): MapShouldWrapper[K, V, L]

    Implicitly converts an object of type scala.collection.GenMap[K, V] to a MapShouldWrapper[K, V], to enable should methods to be invokable on that object.

    Implicitly converts an object of type scala.collection.GenMap[K, V] to a MapShouldWrapper[K, V], to enable should methods to be invokable on that object.

    Definition Classes
    Matchers
  71. implicit def convertToRegexWrapper(o: Regex): RegexWrapper

    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.

    Definition Classes
    Matchers
  72. implicit def convertToStringShouldWrapper(o: String): StringShouldWrapper

    Implicitly converts an object of type java.lang.String to a StringShouldWrapper, to enable should methods to be invokable on that object.

    Implicitly converts an object of type java.lang.String to a StringShouldWrapper, to enable should methods to be invokable on that object.

    Definition Classes
    MatchersShouldVerb
  73. def convertToTraversableLoneElementWrapper[T](xs: GenTraversable[T]): LoneElementTraversableWrapper[T]

    Turn off implicit conversion of LoneElement, so that if user accidentally mixin LoneElement it does conflict with convertToTraversableShouldWrapper

    Turn off implicit conversion of LoneElement, so that if user accidentally mixin LoneElement it does conflict with convertToTraversableShouldWrapper

    Definition Classes
    MatchersLoneElement
  74. implicit def convertToTraversableShouldWrapper[E, L[_] <: GenTraversable[_]](o: L[E]): TraversableShouldWrapper[E, L]

    Implicitly converts an object of type scala.Collection[T] to a CollectionShouldWrapper, to enable should methods to be invokable on that object.

    Implicitly converts an object of type scala.Collection[T] to a CollectionShouldWrapper, to enable should methods to be invokable on that object.

    Definition Classes
    Matchers
  75. implicit def convertTraversableMatcherToArrayMatcher[T](traversableMatcher: Matcher[GenTraversable[T]]): Matcher[Array[T]]

    This implicit conversion method enables the following syntax:

    This implicit conversion method enables the following syntax:

    Array(1, 2) should (not contain (3) and not contain (2))
    

    The (not contain ("two")) expression will result in a Matcher[GenTraversable[String]]. This implicit conversion method will convert that matcher to a Matcher[Array[String]].

    Definition Classes
    Matchers
  76. implicit def convertTraversableMatcherToJavaCollectionMatcher[T](traversableMatcher: Matcher[GenTraversable[T]]): Matcher[Collection[T]]

    This implicit conversion method enables the following syntax (javaColl is a java.util.Collection):

    This implicit conversion method enables the following syntax (javaColl is a java.util.Collection):

    javaColl should contain ("two")
    

    The (contain ("two")) expression will result in a Matcher[GenTraversable[String]]. This implicit conversion method will convert that matcher to a Matcher[java.util.Collection[String]].

    Definition Classes
    Matchers
  77. val decided: DecidedWord

    Definition Classes
    Explicitly
  78. implicit def defaultEquality[A]: Equality[A]

    Return an Equality[A] for any type A that determines equality via the == operator on type A.

    Return an Equality[A] for any type A that determines equality via the == operator on type A.

    returns

    a DefaultEquality for type A

    Definition Classes
    LegacyTripleEqualsEqualityConstraints
  79. def doCollected[T](collected: Collected, xs: GenTraversable[T], methodName: String, stackDepth: Int)(fun: (T) ⇒ Unit): Unit

    Definition Classes
    Matchers
  80. implicit def enablersForArray[E]: Length[Array[E]] with Size[Array[E]]

    Definition Classes
    Matchers
  81. implicit def enablersForGenSeq[E, SEQ[_] <: GenSeq[_]]: Length[SEQ[E]] with Size[SEQ[E]]

    Definition Classes
    Matchers
  82. implicit def enablersForGenTraversable[E, TRAV[_] <: GenTraversable[_]]: Size[TRAV[E]]

    Definition Classes
    Matchers
  83. implicit def enablersForJavaCollection[E, JCOL[_] <: Collection[_]]: Size[JCOL[E]]

    Definition Classes
    Matchers
  84. implicit def enablersForJavaList[E, JLIST[_] <: List[_]]: Length[JLIST[E]] with Size[JLIST[E]]

    Definition Classes
    Matchers
  85. implicit def enablersForJavaMap[K, V, JMAP[_, _] <: Map[_, _]]: Size[JMAP[K, V]]

    Definition Classes
    Matchers
  86. implicit def enablersForMap[K, V, MAP[_, _] <: GenMap[_, _]]: Size[MAP[K, V]]

    Definition Classes
    Matchers
  87. implicit val enablersForString: Length[String] with Size[String]

    Definition Classes
    Matchers
  88. val endWith: EndWithWord

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string should (endWith ("ago") and include ("score"))
                   ^
    

    Definition Classes
    MatcherWords
  89. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  90. def equal(o: Null): Matcher[AnyRef]

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result should equal (null)
           ^
    

    Definition Classes
    Matchers
  91. def equal[T](interval: Interval[T]): Matcher[T]

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    result should equal (100 +- 1)
                  ^
    

    Definition Classes
    Matchers
  92. def equal(right: Any): MatcherFactory1[Any, Equality]

    This method enables the following syntax:

    This method enables the following syntax:

    result should equal (7)
                  ^
    

    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:

    Array(1, 2) should 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.

    Definition Classes
    MatcherWords
  93. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  94. def evaluating(fun: ⇒ Any): ResultOfEvaluatingApplication

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    evaluating { "hi".charAt(-1) } should produce [StringIndexOutOfBoundsException]
    ^
    

    Definition Classes
    Matchers
  95. def every[K, V](xs: GenTraversable[GenMap[K, V]]): ResultOfCollectedGenMap[K, V]

    Definition Classes
    Matchers
  96. def every[T](xs: GenTraversable[Array[T]]): ResultOfCollectedArray[T]

    Definition Classes
    Matchers
  97. def every[E, C[_] <: GenTraversable[_]](xs: GenTraversable[C[E]]): ResultOfCollectedGenTraversable[E, C]

    Definition Classes
    Matchers
  98. def every(xs: GenTraversable[String]): ResultOfCollectedString

    Definition Classes
    Matchers
  99. def every[T](xs: GenTraversable[T]): ResultOfCollectedAny[T]

    Definition Classes
    Matchers
  100. def exactly[K, V](num: Int, xs: GenTraversable[GenMap[K, V]]): ResultOfCollectedGenMap[K, V]

    Definition Classes
    Matchers
  101. def exactly[T](num: Int, xs: GenTraversable[Array[T]]): ResultOfCollectedArray[T]

    Definition Classes
    Matchers
  102. def exactly[E, C[_] <: GenTraversable[_]](num: Int, xs: GenTraversable[C[E]]): ResultOfCollectedGenTraversable[E, C]

    Definition Classes
    Matchers
  103. def exactly(num: Int, xs: GenTraversable[String]): ResultOfCollectedString

    Definition Classes
    Matchers
  104. def exactly[T](num: Int, xs: GenTraversable[T]): ResultOfCollectedAny[T]

    Definition Classes
    Matchers
  105. def fail(cause: Throwable): Nothing

    Throws TestFailedException, with the passed Throwable cause, to indicate a test failed.

    Throws TestFailedException, with the passed Throwable cause, to indicate a test failed. The getMessage method of the thrown TestFailedException will return cause.toString.

    cause

    a Throwable that indicates the cause of the failure.

    Definition Classes
    Assertions
    Exceptions thrown
    NullPointerException

    if cause is null

  106. def fail(message: String, cause: Throwable): Nothing

    Throws TestFailedException, with the passed String message as the exception's detail message and Throwable cause, to indicate a test failed.

    Throws TestFailedException, with the passed String message as the exception's detail message and Throwable cause, to indicate a test failed.

    message

    A message describing the failure.

    cause

    A Throwable that indicates the cause of the failure.

    Definition Classes
    Assertions
    Exceptions thrown
    NullPointerException

    if message or cause is null

  107. def fail(message: String): Nothing

    Throws TestFailedException, with the passed String message as the exception's detail message, to indicate a test failed.

    Throws TestFailedException, with the passed String message as the exception's detail message, to indicate a test failed.

    message

    A message describing the failure.

    Definition Classes
    Assertions
    Exceptions thrown
    NullPointerException

    if message is null

  108. def fail(): Nothing

    Throws TestFailedException to indicate a test failed.

    Throws TestFailedException to indicate a test failed.

    Definition Classes
    Assertions
  109. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  110. val fullyMatch: FullyMatchWord

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string should (fullyMatch regex ("Hel*o, wor.d") and not have length (99))
                   ^
    

    Definition Classes
    MatcherWords
  111. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  112. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  113. val have: HaveWord

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    list should (have length (3) and not contain ('a'))
                 ^
    

    Definition Classes
    MatcherWords
  114. def inOrder[T](xs: T*)(implicit equality: Equality[T]): InOrderContainMatcher[T]

    This method enables the following syntax:

    This method enables the following syntax:

    List(1, 2, 3) should contain (inOrder(1, 2))
                                  ^
    

    Definition Classes
    Matchers
  115. def inOrderOnly[T](xs: T*)(implicit equality: Equality[T]): InOrderOnlyContainMatcher[T]

    This method enables the following syntax:

    This method enables the following syntax:

    List(1, 2, 3) should contain (inOrderOnly(1, 2))
                                  ^
    

    Definition Classes
    Matchers
  116. val include: IncludeWord

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string should (include ("hope") and not startWith ("no"))
                   ^
    

    Definition Classes
    MatcherWords
  117. def intercept[T <: AnyRef](f: ⇒ Any)(implicit manifest: Manifest[T]): T

    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.

    returns

    the intercepted exception, if it is of the expected type

    Definition Classes
    Assertions
    Exceptions thrown
    TestFailedException

    if the passed function does not complete abruptly with an exception that's an instance of the specified type passed expected value.

  118. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  119. val key: KeyWord

    This field enables the following syntax:

    This field enables the following syntax:

    map should not contain key (10)
                           ^
    

    Definition Classes
    Matchers
  120. def legacyEqual(right: Any): Matcher[Any]

    Definition Classes
    MatcherWords
  121. val length: LengthWord

    This field enables the following syntax:

    This field enables the following syntax:

    "hi" should not have length (3)
                         ^
    

    Definition Classes
    MatcherWords
  122. def lowPriorityConversionCheckedEqualityConstraint[A, B](implicit equalityOfB: Equality[B], cnv: (A) ⇒ B): EqualityConstraint[A, B]

    Provides an EqualityConstraint[A, B] class for any two types A and B, enforcing the type constraint that A is implicitly convertible to B, given an implicit Equality[A].

    Provides an EqualityConstraint[A, B] class for any two types A and B, enforcing the type constraint that A is implicitly convertible to B, given an implicit Equality[A].

    The implicitly passed Equality[A] must be used to determine equality by the returned EqualityConstraint's areEqual method.

    This method is overridden and made implicit by subtraits LowPriorityConversionCheckedConstraint (extended by ConversionCheckedTripleEquals), and LowPriorityConversionCheckedLegacyConstraint (extended by ConversionCheckedLegacyTripleEquals), and overriden as non-implicit by the other subtraits in this package.

    cnv

    an implicit conversion from A to B

    returns

    an EqualityConstraint[A, B] whose areEqual method delegates to the areEqual method of the passed Equality[A].

    Definition Classes
    LegacyTripleEqualsEqualityConstraints
  123. def lowPriorityTypeCheckedEqualityConstraint[A, B](implicit equalityOfA: Equality[A], ev: <:<[A, B]): EqualityConstraint[A, B]

    Provides an EqualityConstraint[A, B] class for any two types A and B, enforcing the type constraint that A must be a subtype of B, given an implicit Equality[A].

    Provides an EqualityConstraint[A, B] class for any two types A and B, enforcing the type constraint that A must be a subtype of B, given an implicit Equality[A].

    The implicitly passed Equality[A] must be used to determine equality by the returned EqualityConstraint's areEqual method.

    This method is overridden and made implicit by subtraits LowPriorityTypeCheckedConstraint (extended by TypeCheckedTripleEquals), and LowPriorityTypeCheckedLegacyConstraint (extended by TypeCheckedLegacyTripleEquals), and overriden as non-implicit by the other subtraits in this package.

    equalityOfA

    an Equality[A] type class to which the EqualityConstraint.areEqual method will delegate to determine equality.

    ev

    evidence that A is a subype of B

    returns

    an EqualityConstraint[A, B] whose areEqual method delegates to the areEqual method of the passed Equality[A].

    Definition Classes
    LegacyTripleEqualsEqualityConstraints
  124. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  125. val newContain: NewContainWord

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    list should (contain ('a') and have length (7))
                 ^
    

    Definition Classes
    MatcherWords
  126. def newOneOf(xs: Any*): ResultOfNewOneOfApplication

    This method enables the following syntax:

    This method enables the following syntax:

    List(1, 2, 3) should contain (oneOf(1, 2))
                                  ^
    

    Definition Classes
    Matchers
  127. def no[K, V](xs: GenTraversable[GenMap[K, V]]): ResultOfCollectedGenMap[K, V]

    Definition Classes
    Matchers
  128. def no[T](xs: GenTraversable[Array[T]]): ResultOfCollectedArray[T]

    Definition Classes
    Matchers
  129. def no[E, C[_] <: GenTraversable[_]](xs: GenTraversable[C[E]]): ResultOfCollectedGenTraversable[E, C]

    Definition Classes
    Matchers
  130. def no(xs: GenTraversable[String]): ResultOfCollectedString

    Definition Classes
    Matchers
  131. def no[T](xs: GenTraversable[T]): ResultOfCollectedAny[T]

    Definition Classes
    Matchers
  132. def noneOf[T](xs: T*)(implicit equality: Equality[T]): NoneOfContainMatcher[T]

    This method enables the following syntax:

    This method enables the following syntax:

    List(1, 2, 3) should contain (noneOf(1, 2))
                                  ^
    

    Definition Classes
    Matchers
  133. val not: NotWord

    This field enables syntax like the following:

    This field enables syntax like the following:

    myFile should (not be an (directory) and not have ('name ("foo.bar")))
                   ^
    

    Definition Classes
    MatcherWords
  134. final def notify(): Unit

    Definition Classes
    AnyRef
  135. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  136. def oneOf[T](xs: T*)(implicit equality: Equality[T]): OneOfContainMatcher[T]

    This method enables the following syntax:

    This method enables the following syntax:

    List(1, 2, 3) should contain (oneOf(1, 2))
                                  ^
    

    Definition Classes
    Matchers
  137. def only[T](xs: T*)(implicit equality: Equality[T]): OnlyContainMatcher[T]

    This method enables the following syntax:

    This method enables the following syntax:

    List(1, 2, 3) should contain (only(1, 2))
                                  ^
    

    Definition Classes
    Matchers
  138. def produce[T](implicit manifest: Manifest[T]): ResultOfProduceInvocation[T]

    This method enables the following syntax:

    This method enables the following syntax:

    evaluating { "hi".charAt(-1) } should produce [StringIndexOutOfBoundsException]
    ^
    

    Definition Classes
    Matchers
  139. val regex: RegexWord

    This field enables the following syntax:

    This field enables the following syntax:

    "eight" should not fullyMatch regex ("""(-)?(\d+)(\.\d*)?""".r)
                                  ^
    

    Definition Classes
    Matchers
  140. val size: SizeWord

    This field enables the following syntax:

    This field enables the following syntax:

    set should not have size (3)
                        ^
    

    Definition Classes
    MatcherWords
  141. val startWith: StartWithWord

    This method enables syntax such as the following:

    This method enables syntax such as the following:

    string should (startWith ("Four") and include ("year"))
                   ^
    

    Definition Classes
    MatcherWords
  142. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  143. def theSameElementsAs[T](xs: Array[T])(implicit equality: Equality[T]): TheSameElementsAsContainMatcher[T]

    This method enables the following syntax:

    This method enables the following syntax:

    traversable should contain (theSameElementsAs(array))
                                ^
    

    Definition Classes
    Matchers
  144. def theSameElementsAs[T](xs: GenTraversable[T])(implicit equality: Equality[T]): TheSameElementsAsContainMatcher[T]

    This method enables the following syntax:

    This method enables the following syntax:

    traversable should contain (theSameElementsAs(anotherTraversable))
                                ^
    

    Definition Classes
    Matchers
  145. val theSameInstanceAs: TheSameInstanceAsPhrase

    This field enables the following syntax:

    This field enables the following syntax:

    oneString should not be theSameInstanceAs (anotherString)
                            ^
    

    Definition Classes
    Matchers
  146. def theSameIteratedElementsAs[T](xs: Array[T])(implicit equality: Equality[T]): TheSameIteratedElementsAsContainMatcher[T]

    This method enables the following syntax:

    This method enables the following syntax:

    traversable should contain (theSameIteratedElementsAs(array))
                                ^
    

    Definition Classes
    Matchers
  147. def theSameIteratedElementsAs[T](xs: GenTraversable[T])(implicit equality: Equality[T]): TheSameIteratedElementsAsContainMatcher[T]

    This method enables the following syntax:

    This method enables the following syntax:

    traversable should contain (theSameIteratedElementsAs(anotherTraversable))
                                ^
    

    Definition Classes
    Matchers
  148. def toString(): String

    Definition Classes
    AnyRef → Any
  149. def typeCheckedEqualityConstraint[A, B](implicit equalityOfA: Equality[A], ev: <:<[B, A]): EqualityConstraint[A, B]

    Provides an EqualityConstraint[A, B] class for any two types A and B, enforcing the type constraint that B must be a subtype of A, given an implicit Equality[A].

    Provides an EqualityConstraint[A, B] class for any two types A and B, enforcing the type constraint that B must be a subtype of A, given an implicit Equality[A].

    The implicitly passed Equality[A] must be used to determine equality by the returned EqualityConstraint's areEqual method.

    This method is overridden and made implicit by subtraits TypeCheckedTripleEquals) and TypeCheckedLegacyTripleEquals, and overriden as non-implicit by the other subtraits in this package.

    equalityOfA

    an Equality[A] type class to which the EqualityConstraint.areEqual method will delegate to determine equality.

    ev

    evidence that B is a subype of A

    returns

    an EqualityConstraint[A, B] whose areEqual method delegates to the areEqual method of the passed Equality[A].

    Definition Classes
    LegacyTripleEqualsEqualityConstraints
  150. implicit def unconstrainedEquality[A, B](implicit equalityOfA: Equality[A]): EqualityConstraint[A, B]

    Provides an EqualityConstraint[A, B] class for any two types A and B, with no type constraint enforced, given an implicit Equality[A].

    Provides an EqualityConstraint[A, B] class for any two types A and B, with no type constraint enforced, given an implicit Equality[A].

    The implicitly passed Equality[A] must be used to determine equality by the returned EqualityConstraint's areEqual method.

    This method is overridden and made implicit by subtraits TripleEquals and LegacyTripleEquals, and overriden as non-implicit by the other subtraits in this package.

    equalityOfA

    an Equality[A] type class to which the EqualityConstraint.areEqual method will delegate to determine equality.

    returns

    an EqualityConstraint[A, B] whose areEqual method delegates to the areEqual method of the passed Equality[A].

    Definition Classes
    LegacyTripleEqualsEqualityConstraints
  151. val value: ValueWord

    This field enables the following syntax:

    This field enables the following syntax:

    map should not contain value (10)
                           ^
    

    Definition Classes
    Matchers
  152. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  153. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  154. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  155. implicit def withArrayElementEquality[E](implicit equality: Equality[E]): Holder[Array[E]]

    Definition Classes
    Matchers
  156. def withClue[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:

    withClue("(Employee's name was: " + employee.name + ")") {
      intercept[IllegalArgumentException] {
        employee.getTask(-1)
      }
    }
    

    If an invocation of intercept completed abruptly with an exception, the resulting message would be something like:

    (Employee's name was Bob Jones) Expected IllegalArgumentException to be thrown, but no exception was thrown
    

    Definition Classes
    Assertions
    Exceptions thrown
    NullPointerException

    if the passed clue is null

  157. implicit def withGenMapElementEquality[K, V, MAP[_, _] <: GenMap[_, _]](implicit equality: Equality[(K, V)]): Holder[MAP[K, V]]

    Definition Classes
    Matchers
  158. implicit def withGenTraversableElementEquality[E, TRAV[_] <: GenTraversable[_]](implicit equality: Equality[E]): Holder[TRAV[E]]

    Definition Classes
    Matchers
  159. implicit def withJavaCollectionElementEquality[E, JCOL[_] <: Collection[_]](implicit equality: Equality[E]): Holder[JCOL[E]]

    Definition Classes
    Matchers
  160. implicit def withOptionValueEquality[E, OPT[_] <: Option[_]](implicit equality: Equality[E]): Holder[OPT[E]]

    Definition Classes
    Matchers
  161. implicit def withStringCharacterEquality(implicit equality: Equality[Char]): Holder[String]

    Definition Classes
    Matchers

Deprecated Value Members

  1. def expect(expected: Any)(actual: Any): Unit

    This expect method has been deprecated; Please use expectResult instead.

    This expect method has been deprecated; Please use expectResult instead.

    To get rid of the deprecation warning, simply replace expect with expectResult. The name expect will be used for a different purposes in a future version of ScalaTest.

    Definition Classes
    Assertions
    Annotations
    @deprecated
    Deprecated

    This expect method has been deprecated. Please replace all invocations of expect with an identical invocation of expectResult instead.

  2. def expect(expected: Any, clue: Any)(actual: Any): Unit

    This expect method has been deprecated; Please use expectResult instead.

    This expect method has been deprecated; Please use expectResult instead.

    To get rid of the deprecation warning, simply replace expect with expectResult. The name expect will be used for a different purposes in a future version of ScalaTest.

    Definition Classes
    Assertions
    Annotations
    @deprecated
    Deprecated

    This expect method has been deprecated. Please replace all invocations of expect with an identical invocation of expectResult instead.

  3. def expectResult(expected: Any)(actual: Any): Unit

    This expectResult method has been deprecated; Please use assertResult instead.

    This expectResult method has been deprecated; Please use assertResult instead.

    To get rid of the deprecation warning, simply replace expectResult with assertResult. The name expectResult will be used for a different purposes in a future version of ScalaTest.

    Definition Classes
    Assertions
    Annotations
    @deprecated
    Deprecated

    This expectResult method has been deprecated. Please replace all invocations of expectResult with an identical invocation of assertResult instead.

  4. def expectResult(expected: Any, clue: Any)(actual: Any): Unit

    This expectResult method has been deprecated; Please use assertResult instead.

    This expectResult method has been deprecated; Please use assertResult instead.

    To get rid of the deprecation warning, simply replace expectResult with assertResult. The name expectResult will be used for a different purposes in a future version of ScalaTest.

    Definition Classes
    Assertions
    Annotations
    @deprecated
    Deprecated

    This expectResult method has been deprecated. Please replace all invocations of expectResult with an identical invocation of assertResult instead.

Inherited from AssertionsForJUnit

Inherited from matchers.ShouldMatchers

Inherited from Matchers

Inherited from Explicitly

Inherited from MatcherWords

Inherited from LoneElement

Inherited from ShouldVerb

Inherited from Tolerance

Inherited from Assertions

Inherited from LegacyTripleEquals

Inherited from EqualityConstraints

Inherited from AnyRef

Inherited from Any

Ungrouped