org.scalatest.mock

# JMockExpectations

#### class JMockExpectations extends 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(<span class="stReserved">with</span>("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"))

Attributes
  final

Linear Supertypes
Expectations, ActionClause, ArgumentConstraintPhrases, CardinalityClause, ExpectationBuilder, AnyRef, Any
Ordering

1. Alphabetic
2. By inheritance

Inherited

1. Hide All
2. Show all

1. JMockExpectations
2. Expectations
3. ActionClause
4. ArgumentConstraintPhrases
5. CardinalityClause
6. ExpectationBuilder
7. AnyRef
8. Any

Visibility

1. Public
2. All

### Instance Constructors

1. #### new JMockExpectations ()

### Value Members

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

   Attributes
     final
   Definition Classes
     AnyRef

2. #### def != (arg0: Any): Boolean

   Attributes
     final
   Definition Classes
     Any

3. #### def ## (): Int

   Attributes
     final
   Definition Classes
     AnyRef → Any

4. #### def == (arg0: AnyRef): Boolean

   Attributes
     final
   Definition Classes
     AnyRef

5. #### def == (arg0: Any): Boolean

   Attributes
     final
   Definition Classes
     Any

6. #### def allowing [T] (arg0: T): T

   Definition Classes
     Expectations → CardinalityClause

7. #### def allowing (arg0: org.hamcrest.Matcher[_]): MethodClause

   Definition Classes
     Expectations → CardinalityClause

8. #### def asInstanceOf [T0] : T0

   Attributes
     final
   Definition Classes
     Any

9. #### def atLeast (arg0: Int): ReceiverClause

   Definition Classes
     Expectations → CardinalityClause

10. #### def atMost (arg0: Int): ReceiverClause

    Definition Classes
      Expectations → CardinalityClause

11. #### def between (arg0: Int, arg1: Int): ReceiverClause

    Definition Classes
      Expectations → CardinalityClause

12. #### def buildExpectations (arg0: Action, arg1: ExpectationCollector): Unit

    Definition Classes
      Expectations → ExpectationBuilder

13. #### def clone (): AnyRef

    Attributes
      protected[lang]
    Definition Classes
      AnyRef
    Annotations
      @throws()

14. #### def currentBuilder (): InvocationExpectationBuilder

    Attributes
      protected[jmock]
    Definition Classes
      Expectations

15. #### def eq (arg0: AnyRef): Boolean

    Attributes
      final
    Definition Classes
      AnyRef

16. #### def equals (arg0: Any): Boolean

    Definition Classes
      AnyRef → Any

17. #### def exactly (arg0: Int): ReceiverClause

    Definition Classes
      Expectations → CardinalityClause

18. #### def finalize (): Unit

    Attributes
      protected[lang]
    Definition Classes
      AnyRef
    Annotations
      @throws()

19. #### def getClass (): java.lang.Class[_]

    Attributes
      final
    Definition Classes
      AnyRef

20. #### def hashCode (): Int

    Definition Classes
      AnyRef → Any

21. #### def ignoring (arg0: org.hamcrest.Matcher[_]): MethodClause

    Definition Classes
      Expectations → CardinalityClause

22. #### def ignoring [T] (arg0: T): T

    Definition Classes
      Expectations → CardinalityClause

23. #### def inSequence (arg0: Sequence): Unit

    Definition Classes
      Expectations

24. #### def inSequences (arg0: <repeated...>[Sequence]): Unit

    Definition Classes
      Expectations

25. #### def isInstanceOf [T0] : Boolean

    Attributes
      final
    Definition Classes
      Any

26. #### def ne (arg0: AnyRef): Boolean

    Attributes
      final
    Definition Classes
      AnyRef

27. #### def never [T] (arg0: T): T

    Definition Classes
      Expectations → CardinalityClause

28. #### def notify (): Unit

    Attributes
      final
    Definition Classes
      AnyRef

29. #### def notifyAll (): Unit

    Attributes
      final
    Definition Classes
      AnyRef

30. #### def one [T] (arg0: T): T

    Definition Classes
      Expectations → CardinalityClause

31. #### def oneOf [T] (arg0: T): T

    Definition Classes
      Expectations

32. #### def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
      final
    Definition Classes
      AnyRef

33. #### def then (arg0: State): Unit

    Definition Classes
      Expectations

34. #### def toString (): String

    Definition Classes
      AnyRef → Any

35. #### def wait (): Unit

    Attributes
      final
    Definition Classes
      AnyRef
    Annotations
      @throws()

36. #### def wait (arg0: Long, arg1: Int): Unit

    Attributes
      final
    Definition Classes
      AnyRef
    Annotations
      @throws()

37. #### def wait (arg0: Long): Unit

    Attributes
      final
    Definition Classes
      AnyRef
    Annotations
      @throws()

38. #### def when (arg0: StatePredicate): Unit

    Definition Classes
      Expectations

39. #### def will (arg0: Action): Unit

    Definition Classes
      Expectations → ActionClause

40. #### def with [T] (arg0: T): T

    Definition Classes
      Expectations

41. #### def with (arg0: Double): Double

    Definition Classes
      Expectations

42. #### def with (arg0: Float): Float

    Definition Classes
      Expectations

43. #### def with (arg0: Long): Long

    Definition Classes
      Expectations

44. #### def with (arg0: Int): Int

    Definition Classes
      Expectations

45. #### def with (arg0: Char): Char

    Definition Classes
      Expectations

46. #### def with (arg0: Short): Short

    Definition Classes
      Expectations

47. #### def with (arg0: Byte): Byte

    Definition Classes
      Expectations

48. #### def with (arg0: Boolean): Boolean

    Definition Classes
      Expectations

49. #### def with (arg0: Matcher[Double]): Double

    Definition Classes
      Expectations → ArgumentConstraintPhrases

50. #### def with (arg0: Matcher[Float]): Float

    Definition Classes
      Expectations → ArgumentConstraintPhrases

51. #### def with (arg0: Matcher[Long]): Long

    Definition Classes
      Expectations → ArgumentConstraintPhrases

52. #### def with (arg0: Matcher[Integer]): Int

    Definition Classes
      Expectations → ArgumentConstraintPhrases

53. #### def with (arg0: Matcher[Character]): Char

    Definition Classes
      Expectations

54. #### def with (arg0: Matcher[Short]): Short

    Definition Classes
      Expectations → ArgumentConstraintPhrases

55. #### def with (arg0: Matcher[Byte]): Byte

    Definition Classes
      Expectations → ArgumentConstraintPhrases

56. #### def with (arg0: Matcher[Boolean]): Boolean

    Definition Classes
      Expectations → ArgumentConstraintPhrases

57. #### def with [T] (arg0: Matcher[T]): T

    Definition Classes
      Expectations → ArgumentConstraintPhrases

58. #### def withArg (matcher: Matcher[Char]): Char

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

59. #### def withArg (matcher: Matcher[Double]): Double

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

60. #### def withArg (matcher: Matcher[Float]): Float

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

61. #### def withArg (matcher: Matcher[Boolean]): Boolean

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

62. #### def withArg (matcher: Matcher[Long]): Long

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

63. #### def withArg (matcher: Matcher[Byte]): Byte

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

64. #### def withArg (matcher: Matcher[Short]): Short

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

65. #### def withArg (matcher: Matcher[Int]): Int

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

66. #### def withArg [T] (matcher: Matcher[T]): T

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

67. #### def withArg (value: Char): Char

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

68. #### def withArg (value: Double): Double

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

69. #### def withArg (value: Float): Float

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

70. #### def withArg (value: Boolean): Boolean

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

71. #### def withArg (value: Long): Long

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

72. #### def withArg (value: Byte): Byte

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

73. #### def withArg (value: Short): Short

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

74. #### def withArg (value: Int): Int

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

75. #### def withArg [T] (value: T): T

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

### Inherited from Expectations

### Inherited from ActionClause

### Inherited from ArgumentConstraintPhrases

### Inherited from CardinalityClause

### Inherited from ExpectationBuilder

### Inherited from AnyRef

### Inherited from Any