Announcing HMock 0.3

  • You can now use the WholeMethodMatcher type in an expectation to write a custom predicate that looks at more than one argument at a time when deciding whether to match a method call.
  • You can now add side-effects to methods using whenever. You should prefer to avoid this and use expectations instead, since if you’re not careful side-effects can accidentally match method calls that you weren’t looking for. But occasionally this can be very useful.
  • You can now mock methods with a polymorphic return type. There must be a Typeable constraint on the return type for this to work.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Chris Smith

Chris Smith

Software engineer, volunteer K-12 math and computer science teacher, author of the CodeWorld platform, amateur ring theorist, and Haskell enthusiast.