Packages

c

org.scalatest.jmock

JMockExpectations

final class JMockExpectations extends jmock.Expectations

Subclass of org.jmock.Expectations that provides withArg alternatives to the with methods defined in its superclass.

JMockCycle's expecting method of passes an instance of this class to the function passed into expectations. Because JMockExpectations extends org.jmock.Expectations, all of the Expectations methods are available to be invoked on instances of this class, in addition to several overloaded withArg methods defined in this class. These withArg methods simply invoke corresponding with methods on this. Because with is a keyword in Scala, to invoke these directly you must surround them in back ticks, like this:

oneOf (mockCollaborator).documentAdded(`with`("Document"))

By importing the members of the JMockExpectations object passed to a JMockCycle's executing method, you can instead call withArg with no back ticks needed:

oneOf (mockCollaborator).documentAdded(withArg("Document"))

Annotations
@deprecated
Deprecated

JMockExpectations has been moved from org.scalatest.jmock to org.scalatestplus.jmock. Please update your imports, as this deprecated type alias will be removed in a future version of ScalaTest.

Source
JMockExpectations.scala
Linear Supertypes
jmock.Expectations, AbstractExpectations, ActionClause, ArgumentConstraintPhrases, CardinalityClause, ExpectationBuilder, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JMockExpectations
  2. Expectations
  3. AbstractExpectations
  4. ActionClause
  5. ArgumentConstraintPhrases
  6. CardinalityClause
  7. ExpectationBuilder
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new JMockExpectations()

Value Members

  1. def allowing[T](arg0: T): T
    Definition Classes
    AbstractExpectations → CardinalityClause
  2. def allowing(arg0: Matcher[_]): MethodClause
    Definition Classes
    AbstractExpectations → CardinalityClause
  3. def atLeast(arg0: Int): ReceiverClause
    Definition Classes
    AbstractExpectations → CardinalityClause
  4. def atMost(arg0: Int): ReceiverClause
    Definition Classes
    AbstractExpectations → CardinalityClause
  5. def between(arg0: Int, arg1: Int): ReceiverClause
    Definition Classes
    AbstractExpectations → CardinalityClause
  6. def buildExpectations(arg0: Action, arg1: ExpectationCollector): Unit
    Definition Classes
    AbstractExpectations → ExpectationBuilder
  7. def exactly(arg0: Int): ReceiverClause
    Definition Classes
    AbstractExpectations → CardinalityClause
  8. def ignoring(arg0: Matcher[_]): MethodClause
    Definition Classes
    AbstractExpectations → CardinalityClause
  9. def ignoring[T](arg0: T): T
    Definition Classes
    AbstractExpectations → CardinalityClause
  10. def inSequence(arg0: Sequence): Unit
    Definition Classes
    AbstractExpectations
  11. def inSequences(arg0: <repeated...>[Sequence]): Unit
    Definition Classes
    AbstractExpectations
    Annotations
    @transient()
  12. def never[T](arg0: T): T
    Definition Classes
    AbstractExpectations → CardinalityClause
  13. def oneOf[T](arg0: T): T
    Definition Classes
    AbstractExpectations → CardinalityClause
  14. def then(arg0: State): Unit
    Definition Classes
    AbstractExpectations
  15. def when(arg0: StatePredicate): Unit
    Definition Classes
    AbstractExpectations
  16. def will(arg0: Action): Unit
    Definition Classes
    AbstractExpectations → ActionClause
  17. def with(arg0: Matcher[Double]): Double
    Definition Classes
    Expectations
  18. def with(arg0: Matcher[Float]): Float
    Definition Classes
    Expectations
  19. def with(arg0: Matcher[Long]): Long
    Definition Classes
    Expectations
  20. def with(arg0: Matcher[Integer]): Int
    Definition Classes
    Expectations
  21. def with(arg0: Matcher[Character]): Char
    Definition Classes
    Expectations
  22. def with(arg0: Matcher[Short]): Short
    Definition Classes
    Expectations
  23. def with(arg0: Matcher[Byte]): Byte
    Definition Classes
    Expectations
  24. def with(arg0: Matcher[Boolean]): Boolean
    Definition Classes
    Expectations
  25. def with[T](arg0: T): T
    Definition Classes
    AbstractExpectations
  26. def with(arg0: Double): Double
    Definition Classes
    AbstractExpectations
  27. def with(arg0: Float): Float
    Definition Classes
    AbstractExpectations
  28. def with(arg0: Long): Long
    Definition Classes
    AbstractExpectations
  29. def with(arg0: Int): Int
    Definition Classes
    AbstractExpectations
  30. def with(arg0: Char): Char
    Definition Classes
    AbstractExpectations
  31. def with(arg0: Short): Short
    Definition Classes
    AbstractExpectations
  32. def with(arg0: Byte): Byte
    Definition Classes
    AbstractExpectations
  33. def with(arg0: Boolean): Boolean
    Definition Classes
    AbstractExpectations
  34. def with[T](arg0: Matcher[T]): T
    Definition Classes
    AbstractExpectations → ArgumentConstraintPhrases
  35. def withArg(matcher: Matcher[Char]): Char

    Invokes with on this instance, passing in the passed matcher.

  36. def withArg(matcher: Matcher[Double]): Double

    Invokes with on this instance, passing in the passed matcher.

  37. def withArg(matcher: Matcher[Float]): Float

    Invokes with on this instance, passing in the passed matcher.

  38. def withArg(matcher: Matcher[Boolean]): Boolean

    Invokes with on this instance, passing in the passed matcher.

  39. def withArg(matcher: Matcher[Long]): Long

    Invokes with on this instance, passing in the passed matcher.

  40. def withArg(matcher: Matcher[Byte]): Byte

    Invokes with on this instance, passing in the passed matcher.

  41. def withArg(matcher: Matcher[Short]): Short

    Invokes with on this instance, passing in the passed matcher.

  42. def withArg(matcher: Matcher[Int]): Int

    Invokes with on this instance, passing in the passed matcher.

  43. def withArg[T](matcher: Matcher[T]): T

    Invokes with on this instance, passing in the passed matcher.

  44. def withArg(value: Char): Char

    Invokes with on this instance, passing in the passed value.

  45. def withArg(value: Double): Double

    Invokes with on this instance, passing in the passed value.

  46. def withArg(value: Float): Float

    Invokes with on this instance, passing in the passed value.

  47. def withArg(value: Boolean): Boolean

    Invokes with on this instance, passing in the passed value.

  48. def withArg(value: Long): Long

    Invokes with on this instance, passing in the passed value.

  49. def withArg(value: Byte): Byte

    Invokes with on this instance, passing in the passed value.

  50. def withArg(value: Short): Short

    Invokes with on this instance, passing in the passed value.

  51. def withArg(value: Int): Int

    Invokes with on this instance, passing in the passed value.

  52. def withArg[T](value: T): T

    Invokes with on this instance, passing in the passed value.

Deprecated Value Members

  1. def one[T](arg0: T): T
    Definition Classes
    AbstractExpectations → CardinalityClause
    Annotations
    @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.