- 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
Predicatefrom theexplainable-predicatespackage.
- Dramatically simplified the Template Haskell API.
makeMockablenow expects a Type instead of a Name. Use[t|MyClass|].- Most other variants of
makeMockablehave been removed. UsemakeMockableWithOptionsinstead. makeMockablewill now detect when instances already exist and won't redefine them.makeMockable [t|MyClass ConcreteType|]now definesMockableandMockableBasefor anyMyClasstype. OnlyMockTinstances use the concrete type. In some cases, you may need to add type annotations to your expectations.
MockSetupcan now add expectations.- Added a lot more configuration for severity of faults:
setAmbiguityCheckcan now set to ignore, warning, or error.- Added
setUninterestingActionCheckfor actions with no expectations. - Added
setUnexpectedActionCheckfor actions that don't match expectations. - Added
setUnmetExpectationCheckfor expectations that aren't met.
- Predicates have undergone major updates.
- Predicates now show more detailed messages when they fail.
- New
keysandvaluespredicates accept any child predicate. - Removed
containsKey,containsEntry,keysAre, andentriesAre- Instead of
containsEntryorentriesAre, usecontainsorunorderedElemsArewithzipP.
- Instead of
- New predicates:
positive,negative,nonPositive,nonNegative.
- Methods with polymorphic return types can now be mocked if the return type has
a
Typeableconstraint. - Added
wheneverto associate a side effect to a method. - Added
WholeMethodMatcherto match entire method args at once. allowUnexpectedno 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
allowUnexpectedthat - causes unexpected calls to be ignored and optionally provide a response, but
doesn't conflict with expectations that override it. Ambiuguous uses of
expectAnycan often be replaced withallowUnexpected.
- Restricted mockable setup to defaults to avoid race conditions.
- Setup handlers now run in the
MockSetupmonad. - Adding expectations from setup is no longer allowed. However, you can use
allowUnexpectedto allow unexpected calls.
- Setup handlers now run in the
- Added
nestMockTandwithNestedMockTto 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.