- Version bounds now allow GHC 9.10
- Version bounds now allow GHC 9.6 and 9.8
- Fix Quasi instance warning for GHC 9.4
- Bumped dependency version upper bounds
- Version bounds now allow GHC 9.4
- HMock works with more classes with superclass constraints.
- Classes with default methods are now fully mockable.
- Builds with GHC 9.2.1
- Fixes for GHC 8.4 and 8.6
- HMock now depends on
Predicate
from theexplainable-predicates
package.
- Dramatically simplified the Template Haskell API.
makeMockable
now expects a Type instead of a Name. Use[t|MyClass|]
.- Most other variants of
makeMockable
have been removed. UsemakeMockableWithOptions
instead. makeMockable
will now detect when instances already exist and won't redefine them.makeMockable [t|MyClass ConcreteType|]
now definesMockable
andMockableBase
for anyMyClass
type. OnlyMockT
instances use the concrete type. In some cases, you may need to add type annotations to your expectations.
MockSetup
can now add expectations.- Added a lot more configuration for severity of faults:
setAmbiguityCheck
can now set to ignore, warning, or error.- Added
setUninterestingActionCheck
for actions with no expectations. - Added
setUnexpectedActionCheck
for actions that don't match expectations. - Added
setUnmetExpectationCheck
for expectations that aren't met.
- Predicates have undergone major updates.
- Predicates now show more detailed messages when they fail.
- New
keys
andvalues
predicates accept any child predicate. - Removed
containsKey
,containsEntry
,keysAre
, andentriesAre
- Instead of
containsEntry
orentriesAre
, usecontains
orunorderedElemsAre
withzipP
.
- Instead of
- New predicates:
positive
,negative
,nonPositive
,nonNegative
.
- Methods with polymorphic return types can now be mocked if the return type has
a
Typeable
constraint. - Added
whenever
to associate a side effect to a method. - Added
WholeMethodMatcher
to match entire method args at once. allowUnexpected
no longer changes the default for expected calls.
- Added ambiguity checking.
- This is an optional feature, which is off by default.
- To make it easier to avoid ambiguity, there is now an
allowUnexpected
that - causes unexpected calls to be ignored and optionally provide a response, but
doesn't conflict with expectations that override it. Ambiuguous uses of
expectAny
can often be replaced withallowUnexpected
.
- Restricted mockable setup to defaults to avoid race conditions.
- Setup handlers now run in the
MockSetup
monad. - Adding expectations from setup is no longer allowed. However, you can use
allowUnexpected
to allow unexpected calls.
- Setup handlers now run in the
- Added
nestMockT
andwithNestedMockT
to the API. - Exported smaller modules to make selective imports easier.
- Fixed a bad dependency that broke some GHC versions.
- First version. Released on an unsuspecting world.