Test factories for Ash resources
Find a file
James Harton 5368a030dd
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
chore: release version v0.9.0
2024-05-28 21:51:27 +00:00
.vscode fix: Include :variant in option schema. 2024-05-28 16:40:43 +12:00
config chore: Update forgejo hostname. 2024-02-05 15:28:53 +13:00
documentation/dsls feat: Auto build/load factory options. (#83) 2024-05-29 09:50:43 +12:00
lib feat: Auto build/load factory options. (#83) 2024-05-29 09:50:43 +12:00
test feat: Auto build/load factory options. (#83) 2024-05-29 09:50:43 +12:00
.check.exs chore: add spark cheat sheets to CI. 2023-09-21 11:01:45 +12:00
.doctor.exs feat: Factory DSL and param building. 2023-08-16 20:45:09 +12:00
.drone.yml chore: re-enable auto releasing now that Ash 3.0 is out. 2024-05-20 16:56:17 +12:00
.formatter.exs feat: Auto build/load factory options. (#83) 2024-05-29 09:50:43 +12:00
.gitignore chore: initial commit. 2023-08-09 20:22:44 +12:00
.tool-versions chore(deps): update dependency elixir to v1.16.3 2024-05-21 11:21:16 +12:00
CHANGELOG.md chore: release version v0.9.0 2024-05-28 21:51:27 +00:00
LICENSE.md chore: initial commit. 2023-08-09 20:22:44 +12:00
mix.exs chore: release version v0.9.0 2024-05-28 21:51:27 +00:00
mix.lock chore(deps): update dependency ash to v3.0.8 2024-05-29 07:19:14 +12:00
README.md chore: release version v0.9.0 2024-05-28 21:51:27 +00:00
renovate.json chore(deps): add renovate.json 2023-08-16 22:13:01 +12:00

Smokestack

Build Status Hippocratic License HL3-FULL

Smokestack provides a way to define test factories for your Ash Resources using a convenient DSL:

defmodule MyApp.Factory do
  use Smokestack

  factory Character do
    attribute :name, &Faker.StarWars.character/0
    attribute :affiliation, choose(["Galactic Empire", "Rebel Alliance"])
  end

  factory Character, :trek do
    attribute :name, choose(["J.L. Pipes", "Severn", "Slickback"])
    attribute :affiliation, choose(["Entrepreneur", "Voyager"])
  end
end

defmodule MyApp.CharacterTest do
  use MyApp.DataCase
  use MyApp.Factory

  test "it can build a character" do
    assert character = insert!(Character)
  end
end

Installation

Smokestack is available on Hex you can add it directly to your mix.exs:

def deps do
  [
    {:smokestack, "~> 0.9.0"},
  ]
end

Documentation for the latest release is available on HexDocs.

Github Mirror

This repository is mirrored on Github from it's primary location on my Forgejo instance. Feel free to raise issues and open PRs on Github.

License

This software is licensed under the terms of the HL3-FULL, see the LICENSE.md file included with this package for the terms.

This license actively proscribes this software being used by and for some industries, countries and activities. If your usage of this software doesn't comply with the terms of this license, then contact me with the details of your use-case to organise the purchase of a license - the cost of which may include a donation to a suitable charity or NGO.