Announcing HMock 0.2

Rejecting ambiguous expectations

expect $ ReadFile_ anything |-> "some content"
expect $ ReadFile "foo.txt" |-> "foo content"
x <- readFile "foo.txt"

MockSetup monad

  • Perform arbitrary I/O.
  • Add expectations.

Nesting MockT

  • Has its own options, such as defaults and ambiguity checking, which are originally the same as the parent. Changing them takes effect in the nested block, but the changes are reverted as soon as the nested block completes.
  • Has its own expectations. The expectations of the nested block may be interleaved with the expectations of its parent, but when the block finishes, its own expectations must be satisfied.

Module Structure

HMock 0.2 module structure

Caution! Unstable API

--

--

--

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

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

A new boom that could replace Google Translate: KUBAIR

CS373 Fall 2021: Week 9

Rogue Survivor Revived: savefile break

SWE Fall 2020 Final Entry: Alexy Correa

Why Flutter Is Getting More Popular Among The Startups?

Know the history of the first computer programmer ever

Deploy Spring Boot App on AWS EC2

Working With PDFs in Python

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.

More from Medium

PipyJS — A functional style JavaScript engine for programming Pipy

Benchmarking CRuby, MJIT, YJIT, JRuby and TruffleRuby

TDD in Clojure, Part 3— The London school

Release multi-target Rust applications with GitLab CI