StatifierUI.Fixtures.ExpectationError exception (StatifierUI v0.9.1)

Copy Markdown View Source

Raised by StatifierUI.Fixtures.Expectations.check!/2 when one or more stated expect entries did not hold.

A plain exception, not ExUnit.AssertionError - nothing under lib/ may depend on ExUnit being loaded, the same optional-dependency discipline applied to Kino and Phoenix.LiveView. A host wires check!/2 into its own ExUnit test and lets this exception's message do the reporting.

Summary

Functions

Builds the exception from the failing results (as returned by StatifierUI.Fixtures.Expectations.check/2), formatting one line per failure naming its expression, dataset, expected value, actual value, and error.

Types

t()

@type t() :: %StatifierUI.Fixtures.ExpectationError{
  __exception__: true,
  message: String.t(),
  results: [StatifierUI.Fixtures.Expectations.result()]
}

Functions

exception(msg)

@spec exception([StatifierUI.Fixtures.Expectations.result()]) :: t()

Builds the exception from the failing results (as returned by StatifierUI.Fixtures.Expectations.check/2), formatting one line per failure naming its expression, dataset, expected value, actual value, and error.