FixtureBuilder is a library to define and build complex fixtures for your tests.
env = FixtureBuilder.fixtures([
put(:group, :group, %{name: Faker.Team.name()}, [
put(:user, :user)
])
])
assert %Group{} = env.group
assert %User{} = env.group.user
If available in Hex, the package can be installed
by adding fixture_builder
to your list of dependencies in mix.exs
:
def deps do
[
{:fixture_builder, "~> 0.1.0"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/fixture_builder.