package mock

All checked builds pass
  1. Overview
  2. Docs
Configurable functions to test impure code

Install

dune-project
 Dependency

Authors

Maintainers

Sources

1.0.0.tar.gz
md5=67deb0f8161f966bef6a422349dd88ad
sha512=3cad4d869563f4f187cc388170186825e0259a3f0a2d0c956ba47cb1f22ce08860677d80c04451d0b448745d76fef7f1c87e11ac1130548cb8506d5bc5715cd8

Description

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.

Added to opam-repository:

README

Mock - configurable functions to test impure code

Build Status Documentation

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 OUnit is available as mock-ounit.

Dependencies (2)

  1. ocaml >= "4.07.0"
  2. dune

Dev Dependencies

None

Optional Dependencies

None

Used by (1)

  1. mock-ounit

Conflicts (2)

  1. ocaml-compiler = "5.3.0~alpha1"
  2. ocaml-variants = "4.12.0+domains+effects" | = "5.1.1+effect-syntax"

Build status

Results of building mock with each compiler on check.ci.ocaml.org, run of against opam-repository 7cdc698. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
1.0.0 (this version) good good good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure