Test factories for Ash resources
Find a file
James Harton a69e595f65
All checks were successful
continuous-integration/drone/push Build is passing
chore: release version v0.3.1
2023-09-09 19:33:36 +12:00
config chore: add missing git_ops config. 2023-08-17 19:43:48 +12:00
lib docs: improve the readme and moduledocs. 2023-09-08 21:28:26 +12:00
test refactor: Split builders into composable chunks. (#6) 2023-09-08 07:25:39 +12:00
.check.exs feat: Factory DSL and param building. 2023-08-16 20:45:09 +12:00
.doctor.exs feat: Factory DSL and param building. 2023-08-16 20:45:09 +12:00
.drone.yml chore: enable publishing to hex. 2023-09-09 19:32:11 +12:00
.formatter.exs feat: build related parameters when requested. (#4) 2023-09-05 19:37:00 +12:00
.gitignore chore: initial commit. 2023-08-09 20:22:44 +12:00
.tool-versions chore(deps): update dependency elixir to v1.15.5 2023-08-29 00:23:10 +12:00
CHANGELOG.md chore: release version v0.3.1 2023-09-09 19:33:36 +12:00
LICENSE.md chore: initial commit. 2023-08-09 20:22:44 +12:00
mix.exs chore: release version v0.3.1 2023-09-09 19:33:36 +12:00
mix.lock refactor: Split builders into composable chunks. (#6) 2023-09-08 07:25:39 +12:00
README.md docs: improve the readme and moduledocs. 2023-09-08 21:28:26 +12: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 not yet ready to be published to Hex so in the mean time if you want to try it you need to add a git-based dependency:

def deps do
  [
    {:smokestack, git: "https://code.harton.nz/cinder/cinder", tag: "v0.1.0"}
  ]
end

Since the package hasn't been published, there are no docs available on HexDocs, but you can access the latest version here.

Github Mirror

This repository is mirrored on Github from it's primary location on my Forejo 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.