HMock-0.1.0.1: A flexible mock framework for testing effectful code.

Test.HMock.Internal.TH

Synopsis

# Documentation

Custom options for deriving a Mockable class.

Constructors

 MockableOptions FieldsmockSuffix :: StringSuffix to add to Action and Matcher names. Defaults to "".mockVerbose :: BoolWhether to warn about limitations of the generated mocks. This is mostly useful temporarily for finding out why generated code doesn't match your expectations. Defaults to False.

#### Instances

Instances details
 Source # Instance detailsDefined in Test.HMock.Internal.TH Methods

Define all instances necessary to use HMock with the given class. Equivalent to both deriveMockable and deriveForMockT.

If MyClass is a class and myMethod is one of its methods, then makeMockable MyClass generates all of the following:

If MyClass is a class and myMethod is one of its methods, then makeMockable MyClass generates everything generated by makeMockableBase, as well as a Mockable instance that does no setup.

Define all instances necessary to use HMock with the given constraint type, which should be a class applied to zero or more type arguments. Equivalent to both deriveMockableType and deriveTypeForMockT.

See makeMockable for a list of what is generated by this splice.

Define all instances necessary to use HMock with the given class. This is like makeMockable, but with the ability to specify custom options.

See makeMockable for a list of what is generated by this splice.

Define all instances necessary to use HMock with the given constraint type, which should be a class applied to zero or more type arguments. This is like makeMockableType, but with the ability to specify custom options.

See makeMockable for a list of what is generated by this splice.

Defines almost all instances necessary to use HMock with the given class. Equivalent to both deriveMockableBase and deriveForMockT.

Defines almost all instances necessary to use HMock with the given constraint type, which should be a class applied to zero or more type arguments. Equivalent to both deriveMockableBaseType and deriveTypeForMockT.

Defines almost all instances necessary to use HMock with the given class. This is like makeMockable, but with the ability to specify custom options.

Defines almost all instances necessary to use HMock with the given constraint type, which should be a class applied to zero or more type arguments. This is like makeMockableType, but with the ability to specify custom options.

Defines the Mockable instance for the given class.

If MyClass is a class and myMethod is one of its methods, then deriveMockable MyClass generates everything generated by makeMockableBase, as well as a Mockable instance that does no setup.

Defines the Mockable instance for the given constraint type, which should be a class applied to zero or more type arguments.

See deriveMockable for a list of what is generated by this splice.

Defines the Mockable instance for the given class. This is like deriveMockable, but with the ability to specify custom options.

See deriveMockable for a list of what is generated by this splice.

Defines the Mockable instance for the given constraint type, which should be a class applied to zero or more type arguments. This is like deriveMockableType, but with the ability to specify custom options.

See deriveMockable for a list of what is generated by this splice.

Defines the MockableBase instance for the given class.

If MyClass is a class and myMethod is one of its methods, then deriveMockableBase MyClass generates all of the following:

• A MockableBase MyClass instance.
• An associated type Action MyClass, with a constructor MyMethod.
• An associated type Matcher MyClass, with a constructor MyMethod_.
• An Expectable instance for Action MyClass which matches an exact set of arguments, if and only if all of myMethod's arguments have Eq and Show instances.

Defines the MockableBase instance for the given constraint type, which should be a class applied to zero or more type arguments.

See deriveMockableBase for a list of what is generated by this splice.

Defines the MockableBase instance for the given class. This is like deriveMockableBase, but with the ability to specify custom options.

See deriveMockableBase for a list of what is generated by this splice.

Defines the MockableBase instance for the given constraint type, which should be a class applied to zero or more type arguments. This is like deriveMockableBaseType, but with the ability to specify custom options.

See deriveMockableBase for a list of what is generated by this splice.

Defines an instance of the given class for MockT m, delegating all of its methods to mockMethod to be handled by HMock.

This may only be used if all members of the class are mockable methods. If the class contains some unmockable methods, associated types, or other members, you will need to define this instance yourself, delegating the mockable methods as follows:

instance MyClass (MockT m) where
myMethod x y = mockMethod (MyMethod x y)
...


Defines an instance of the given constraint type for MockT m, delegating all of its methods to mockMethod to be handled by HMock. The type should be a class applied to zero or more type arguments.

See deriveForMockT for restrictions on the use of this splice.

Defines an instance of the given class for MockT m, delegating all of its methods to mockMethod to be handled by HMock. This is like deriveForMockT, but with the ability to specify custom options.

See deriveForMockT for restrictions on the use of this splice.

Defines an instance of the given constraint type for MockT m, delegating all of its methods to mockMethod to be handled by HMock. The type should be a class applied to zero or more type arguments. This is like deriveTypeForMockT, but with the ability to specify custom options.

See deriveForMockT for restrictions on the use of this splice.