package mock-ounit

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Mock - configurable functions to test impure code

Build Status docs

This package provides "mocks", fake functions that can be configured to return values or raise exceptions. It is possible to inspect their arguments after their execution. The API is greatly inspired by unittest.mock in Python.

There is no magic under the hood, it is "just" a reference to a function, but it makes it possible to have pleasant output like this in your tests:

A wrapper for OUnit2 is available as mock-ounit.

OCaml

Innovation. Community. Security.