← Graph

Mimic

tool 4 connections

Library in the Eventide toolkit. When passed a class, `Mimic` returns an object that implements that class's interface but does nothing — an implementation of the null-object pattern. Instances are inert by default and can be told to `:record` so tests can ask them whether/how they were interacted with (e.g. `http_client.invoked?(:post)`). Bellware frames mimic substitutes explicitly as *not* mock objects: they are part of the design, not transparency retrofitted onto test files. Used by Eventide components to default their dependencies to substitutable null implementations, so objects are 'useful' immediately on initialization without nil-reference errors.

license
open-source
category
library
tool Mimic
about
Mimic implements the null-object pattern: given a class, it returns an inert implementation of that class's interface.
Demonstrates Eventide's Mimic library to build inert substitutes from a class's interface.
tool Mimic
related_to
Eventide project
Mimic is one of the libraries in the Eventide toolkit.
tool Dependency
uses
Mimic tool
Dependency's default substitute is a recordable Mimic instance — 'mimic plus plus'.

Provenance

Read by
7 extractions