FlowAssertions.StructA (Flow Assertions v0.7.1) View Source

Assertions that apply only to structs, not maps.

Link to this section Summary

Functions

Assert that the value is a particular module's struct.

Link to this section Functions

Link to this function

assert_struct_named(value_to_check, module_name)

View Source

Assert that the value is a particular module's struct.

make_user("fred") |> assert_struct_named(User)

For structs, this has the same purpose as FlowAssertions.MiscA.assert_shape/2. However, because it's not a macro, the second argument can be a variable. That makes it useful for building up larger assertion functions.