Compare commits
33 commits
Author | SHA1 | Date | |
---|---|---|---|
James Harton | ba9f9b1e88 | ||
James Harton | 49f33675be | ||
Renovate Bot | 59e00f6702 | ||
James Harton | 560f70d332 | ||
Renovate Bot | 6f3ed8391d | ||
James Harton | 22358bc5ad | ||
Renovate Bot | 287255377a | ||
Renovate Bot | 8869d0f1ba | ||
Renovate Bot | a76d2869c3 | ||
Renovate Bot | 9501920a95 | ||
Renovate Bot | d9d74bb698 | ||
Renovate Bot | 071359f8ec | ||
James Harton | 9b4923efc3 | ||
Renovate Bot | 69677ee767 | ||
James Harton | 30233ad0d5 | ||
Renovate Bot | 6c5bf02162 | ||
James Harton | 9a040ee688 | ||
Renovate Bot | c639c3afe8 | ||
Renovate Bot | d05d784775 | ||
Renovate Bot | 5ea599b8ec | ||
James Harton | e218eb276b | ||
Renovate Bot | 1bae3c5bea | ||
Renovate Bot | 3fb934281b | ||
Renovate Bot | ab4fecc621 | ||
Renovate Bot | 3a8abb97e6 | ||
Renovate Bot | 0d01c27088 | ||
Renovate Bot | 8dd0542b02 | ||
James Harton | b929429556 | ||
Renovate Bot | fa31b20dbd | ||
James Harton | 2def711641 | ||
James Harton | cd34f2af94 | ||
Renovate Bot | 00d240744e | ||
Renovate Bot | 1e39804bc6 |
|
@ -28,6 +28,7 @@
|
|||
## custom new tools may be added (Mix tasks or arbitrary commands)
|
||||
# {:my_task, "mix my_task", env: %{"MIX_ENV" => "prod"}},
|
||||
# {:my_tool, ["my_tool", "arg with spaces"]}
|
||||
{:spark_formatter, "mix spark.formatter --check"}
|
||||
{:spark_formatter, "mix spark.formatter --check"},
|
||||
{:spark_cheat_sheets, "mix spark.cheat_sheets --check"}
|
||||
]
|
||||
]
|
||||
|
|
34
.drone.yml
34
.drone.yml
|
@ -49,7 +49,7 @@ steps:
|
|||
- .rebar3
|
||||
|
||||
- name: install dependencies
|
||||
image: code.harton.nz/james/asdf_container:latest
|
||||
image: harton.dev/james/asdf_container:latest
|
||||
pull: "always"
|
||||
environment:
|
||||
MIX_ENV: test
|
||||
|
@ -69,6 +69,7 @@ steps:
|
|||
- mix local.rebar --if-missing --force
|
||||
- mix deps.get
|
||||
- mix deps.compile
|
||||
- mix dialyzer --plt
|
||||
|
||||
- name: store ASDF cache
|
||||
image: meltwater/drone-cache
|
||||
|
@ -121,7 +122,7 @@ steps:
|
|||
- .rebar3
|
||||
|
||||
- name: mix compile
|
||||
image: code.harton.nz/james/asdf_container:latest
|
||||
image: harton.dev/james/asdf_container:latest
|
||||
environment:
|
||||
MIX_ENV: test
|
||||
HEX_HOME: /drone/src/.hex
|
||||
|
@ -134,7 +135,7 @@ steps:
|
|||
- asdf mix compile --warnings-as-errors
|
||||
|
||||
- name: mix test
|
||||
image: code.harton.nz/james/asdf_container:latest
|
||||
image: harton.dev/james/asdf_container:latest
|
||||
environment:
|
||||
MIX_ENV: test
|
||||
HEX_HOME: /drone/src/.hex
|
||||
|
@ -147,7 +148,7 @@ steps:
|
|||
- asdf mix test
|
||||
|
||||
- name: mix credo
|
||||
image: code.harton.nz/james/asdf_container:latest
|
||||
image: harton.dev/james/asdf_container:latest
|
||||
environment:
|
||||
MIX_ENV: test
|
||||
HEX_HOME: /drone/src/.hex
|
||||
|
@ -160,7 +161,7 @@ steps:
|
|||
- asdf mix credo --strict
|
||||
|
||||
- name: mix hex.audit
|
||||
image: code.harton.nz/james/asdf_container:latest
|
||||
image: harton.dev/james/asdf_container:latest
|
||||
environment:
|
||||
MIX_ENV: test
|
||||
HEX_HOME: /drone/src/.hex
|
||||
|
@ -173,7 +174,7 @@ steps:
|
|||
- asdf mix hex.audit
|
||||
|
||||
- name: mix format
|
||||
image: code.harton.nz/james/asdf_container:latest
|
||||
image: harton.dev/james/asdf_container:latest
|
||||
environment:
|
||||
MIX_ENV: test
|
||||
HEX_HOME: /drone/src/.hex
|
||||
|
@ -186,7 +187,7 @@ steps:
|
|||
- asdf mix format --check-formatted
|
||||
|
||||
- name: mix spark.formatter
|
||||
image: code.harton.nz/james/asdf_container:latest
|
||||
image: harton.dev/james/asdf_container:latest
|
||||
environment:
|
||||
MIX_ENV: test
|
||||
HEX_HOME: /drone/src/.hex
|
||||
|
@ -199,7 +200,7 @@ steps:
|
|||
- asdf mix spark.formatter --check
|
||||
|
||||
- name: mix spark.cheat_sheets
|
||||
image: code.harton.nz/james/asdf_container:latest
|
||||
image: harton.dev/james/asdf_container:latest
|
||||
environment:
|
||||
MIX_ENV: test
|
||||
HEX_HOME: /drone/src/.hex
|
||||
|
@ -212,7 +213,7 @@ steps:
|
|||
- asdf mix spark.cheat_sheets --check
|
||||
|
||||
- name: mix deps.unlock
|
||||
image: code.harton.nz/james/asdf_container:latest
|
||||
image: harton.dev/james/asdf_container:latest
|
||||
environment:
|
||||
MIX_ENV: test
|
||||
HEX_HOME: /drone/src/.hex
|
||||
|
@ -225,7 +226,7 @@ steps:
|
|||
- asdf mix deps.unlock --check-unused
|
||||
|
||||
- name: mix doctor
|
||||
image: code.harton.nz/james/asdf_container:latest
|
||||
image: harton.dev/james/asdf_container:latest
|
||||
environment:
|
||||
MIX_ENV: test
|
||||
HEX_HOME: /drone/src/.hex
|
||||
|
@ -238,7 +239,7 @@ steps:
|
|||
- asdf mix doctor --full
|
||||
|
||||
- name: mix git_ops.check_message
|
||||
image: code.harton.nz/james/asdf_container:latest
|
||||
image: harton.dev/james/asdf_container:latest
|
||||
environment:
|
||||
MIX_ENV: test
|
||||
HEX_HOME: /drone/src/.hex
|
||||
|
@ -252,7 +253,7 @@ steps:
|
|||
- asdf mix git_ops.check_message .last_commit_message
|
||||
|
||||
- name: mix git_ops.release
|
||||
image: code.harton.nz/james/asdf_container:latest
|
||||
image: harton.dev/james/asdf_container:latest
|
||||
when:
|
||||
branch:
|
||||
- main
|
||||
|
@ -265,6 +266,7 @@ steps:
|
|||
- mix hex.audit
|
||||
- mix format
|
||||
- mix spark.formatter
|
||||
- mix spark.cheat_sheets
|
||||
- mix deps.unlock
|
||||
- mix doctor
|
||||
- mix git_ops.check_message
|
||||
|
@ -293,7 +295,7 @@ steps:
|
|||
- fi
|
||||
|
||||
- name: build artifacts
|
||||
image: code.harton.nz/james/asdf_container:latest
|
||||
image: harton.dev/james/asdf_container:latest
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
|
@ -306,6 +308,7 @@ steps:
|
|||
- mix hex.audit
|
||||
- mix format
|
||||
- mix spark.formatter
|
||||
- mix spark.cheat_sheets
|
||||
- mix deps.unlock
|
||||
- mix doctor
|
||||
- mix git_ops.check_message
|
||||
|
@ -341,7 +344,7 @@ steps:
|
|||
settings:
|
||||
api_key:
|
||||
from_secret: DRONE_TOKEN
|
||||
base_url: https://code.harton.nz
|
||||
base_url: https://harton.dev
|
||||
files: artifacts/*.tar.gz
|
||||
checksum: sha256
|
||||
title: tag_subject
|
||||
|
@ -367,12 +370,11 @@ steps:
|
|||
commands:
|
||||
- mc alias set store $${S3_ENDPOINT} $${ACCESS_KEY} $${SECRET_KEY}
|
||||
- mc mb -p store/docs.harton.nz
|
||||
- mc anonymous set download store/docs.harton.nz
|
||||
- mc mirror --overwrite doc/ store/docs.harton.nz/$${DRONE_REPO}/$${DRONE_TAG}
|
||||
- mc mirror --overwrite doc/ store/docs.harton.nz/$${DRONE_REPO}
|
||||
|
||||
- name: hex release
|
||||
image: code.harton.nz/james/asdf_container:latest
|
||||
image: harton.dev/james/asdf_container:latest
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
elixir 1.15.5
|
||||
erlang 26.0.2
|
||||
elixir 1.16.2
|
||||
erlang 26.2.3
|
||||
|
|
23
CHANGELOG.md
23
CHANGELOG.md
|
@ -5,7 +5,16 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline
|
|||
|
||||
<!-- changelog -->
|
||||
|
||||
## [v0.4.1](https://code.harton.nz/james/smokestack/compare/v0.4.0...v0.4.1) (2023-09-20)
|
||||
## [v0.4.2](https://harton.dev/james/smokestack/compare/v0.4.1...v0.4.2) (2024-03-22)
|
||||
|
||||
|
||||
|
||||
|
||||
### Bug Fixes:
|
||||
|
||||
* Fixes inability to `use` generated factories.
|
||||
|
||||
## [v0.4.1](https://harton.dev/james/smokestack/compare/v0.4.0...v0.4.1) (2023-09-20)
|
||||
|
||||
|
||||
|
||||
|
@ -14,7 +23,7 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline
|
|||
|
||||
* bug in constant mapper.
|
||||
|
||||
## [v0.4.0](https://code.harton.nz/james/smokestack/compare/v0.3.1...v0.4.0) (2023-09-19)
|
||||
## [v0.4.0](https://harton.dev/james/smokestack/compare/v0.3.1...v0.4.0) (2023-09-19)
|
||||
|
||||
|
||||
|
||||
|
@ -23,12 +32,12 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline
|
|||
|
||||
* add template for constant values
|
||||
|
||||
## [v0.3.1](https://code.harton.nz/james/smokestack/compare/v0.3.0...v0.3.1) (2023-09-09)
|
||||
## [v0.3.1](https://harton.dev/james/smokestack/compare/v0.3.0...v0.3.1) (2023-09-09)
|
||||
|
||||
|
||||
|
||||
|
||||
## [v0.3.0](https://code.harton.nz/james/smokestack/compare/v0.2.0...v0.3.0) (2023-09-05)
|
||||
## [v0.3.0](https://harton.dev/james/smokestack/compare/v0.2.0...v0.3.0) (2023-09-05)
|
||||
|
||||
|
||||
|
||||
|
@ -37,7 +46,7 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline
|
|||
|
||||
* build related parameters when requested. (#4)
|
||||
|
||||
## [v0.2.0](https://code.harton.nz/james/smokestack/compare/v0.1.1...v0.2.0) (2023-09-05)
|
||||
## [v0.2.0](https://harton.dev/james/smokestack/compare/v0.1.1...v0.2.0) (2023-09-05)
|
||||
|
||||
|
||||
|
||||
|
@ -46,7 +55,7 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline
|
|||
|
||||
* build related parameters when requested. (#4)
|
||||
|
||||
## [v0.1.1](https://code.harton.nz/james/smokestack/compare/v0.1.0...v0.1.1) (2023-08-18)
|
||||
## [v0.1.1](https://harton.dev/james/smokestack/compare/v0.1.0...v0.1.1) (2023-08-18)
|
||||
|
||||
|
||||
|
||||
|
@ -59,7 +68,7 @@ See [Conventional Commits](Https://conventionalcommits.org) for commit guideline
|
|||
|
||||
* Add `Builder.insert/2..5`.
|
||||
|
||||
## [v0.1.0](https://code.harton.nz/james/smokestack/compare/v0.1.0...v0.1.0) (2023-08-16)
|
||||
## [v0.1.0](https://harton.dev/james/smokestack/compare/v0.1.0...v0.1.0) (2023-08-16)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ add it directly to your `mix.exs`:
|
|||
```elixir
|
||||
def deps do
|
||||
[
|
||||
{:smokestack, "~> 0.3"},
|
||||
{:smokestack, "~> 0.4.2"},
|
||||
]
|
||||
end
|
||||
```
|
||||
|
@ -48,7 +48,7 @@ Documentation for the latest release is available on [HexDocs](http://hexdocs.pm
|
|||
## Github Mirror
|
||||
|
||||
This repository is mirrored [on Github](https://github.com/jimsynz/smokestack)
|
||||
from it's primary location [on my Forejo instance](https://code.harton.nz/james/smokestack).
|
||||
from it's primary location [on my Forgejo instance](https://harton.dev/james/smokestack).
|
||||
Feel free to raise issues and open PRs on Github.
|
||||
|
||||
## License
|
||||
|
|
|
@ -3,7 +3,7 @@ import Config
|
|||
config :git_ops,
|
||||
mix_project: Mix.Project.get!(),
|
||||
changelog_file: "CHANGELOG.md",
|
||||
repository_url: "https://code.harton.nz/james/smokestack",
|
||||
repository_url: "https://harton.dev/james/smokestack",
|
||||
manage_mix_version?: true,
|
||||
version_tag_prefix: "v",
|
||||
manage_readme_version: "README.md"
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
<!--
|
||||
This file was generated by Spark. Do not edit it by hand.
|
||||
-->
|
||||
# DSL: Smokestack.Dsl
|
||||
|
||||
The DSL definition for the Smokestack DSL.
|
||||
|
@ -83,15 +86,16 @@ Define factories for a resource
|
|||
|
||||
|
||||
### Options
|
||||
|
||||
| Name | Type | Default | Docs |
|
||||
| --- | --- | --- | --- |
|
||||
| `api` | `module` | | The default Ash API to use when evaluating loads |
|
||||
|------|------|---------|------|
|
||||
| [`api`](#smokestack-api){: #smokestack-api } | `module` | | The default Ash API to use when evaluating loads |
|
||||
|
||||
|
||||
|
||||
## smokestack.factory
|
||||
```elixir
|
||||
factory resource, variant \ :default
|
||||
factory resource, variant \\ :default
|
||||
```
|
||||
|
||||
|
||||
|
@ -104,14 +108,16 @@ Define factories for a resource
|
|||
|
||||
|
||||
### Arguments
|
||||
|
||||
| Name | Type | Default | Docs |
|
||||
| --- | --- | --- | --- |
|
||||
| `resource`* | `module` | | An Ash Resource |
|
||||
| `variant` | `atom` | `:default` | The name of a factory variant |
|
||||
|------|------|---------|------|
|
||||
| [`resource`](#smokestack-factory-resource){: #smokestack-factory-resource .spark-required} | `module` | | An Ash Resource |
|
||||
| [`variant`](#smokestack-factory-variant){: #smokestack-factory-variant } | `atom` | `:default` | The name of a factory variant |
|
||||
### Options
|
||||
|
||||
| Name | Type | Default | Docs |
|
||||
| --- | --- | --- | --- |
|
||||
| `api` | `module` | | The Ash API to use when evaluating loads |
|
||||
|------|------|---------|------|
|
||||
| [`api`](#smokestack-factory-api){: #smokestack-factory-api } | `module` | | The Ash API to use when evaluating loads |
|
||||
|
||||
|
||||
## smokestack.factory.attribute
|
||||
|
@ -127,10 +133,11 @@ attribute name, generator
|
|||
|
||||
|
||||
### Arguments
|
||||
|
||||
| Name | Type | Default | Docs |
|
||||
| --- | --- | --- | --- |
|
||||
| `name`* | `atom` | | The name of the target attribute |
|
||||
| `generator`* | `(-> any) \| mfa \| (any -> any) \| mfa \| (any, any -> any) \| mfa` | | A function which can generate an appropriate value for the attribute.œ |
|
||||
|------|------|---------|------|
|
||||
| [`name`](#smokestack-factory-attribute-name){: #smokestack-factory-attribute-name .spark-required} | `atom` | | The name of the target attribute |
|
||||
| [`generator`](#smokestack-factory-attribute-generator){: #smokestack-factory-attribute-generator .spark-required} | `(-> any) \| mfa \| (any -> any) \| mfa \| (any, any -> any) \| mfa` | | A function which can generate an appropriate value for the attribute.œ |
|
||||
|
||||
|
||||
|
||||
|
@ -151,3 +158,5 @@ Target: `Smokestack.Dsl.Factory`
|
|||
|
||||
|
||||
|
||||
|
||||
<style type="text/css">.spark-required::after { content: "*"; color: red !important; }</style>
|
|
@ -252,7 +252,7 @@ defmodule Smokestack do
|
|||
|
||||
defmacro __using__(_) do
|
||||
quote do
|
||||
import __MODULE__
|
||||
import unquote(__MODULE__)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
49
mix.exs
49
mix.exs
|
@ -1,7 +1,7 @@
|
|||
defmodule Smokestack.MixProject do
|
||||
use Mix.Project
|
||||
|
||||
@version "0.4.1"
|
||||
@version "0.4.2"
|
||||
|
||||
@moduledoc """
|
||||
Test factories for Ash resources.
|
||||
|
@ -18,17 +18,17 @@ defmodule Smokestack.MixProject do
|
|||
deps: deps(),
|
||||
description: @moduledoc,
|
||||
package: package(),
|
||||
source_url: "https://code.harton.nz/james/smokestack",
|
||||
homepage_url: "https://code.harton.nz/james/smokestack",
|
||||
source_url: "https://harton.dev/james/smokestack",
|
||||
homepage_url: "https://harton.dev/james/smokestack",
|
||||
aliases: aliases(),
|
||||
dialyzer: [plt_add_apps: [:faker]],
|
||||
docs: [
|
||||
main: "Smokestack",
|
||||
main: "readme",
|
||||
extra_section: "GUIDES",
|
||||
formatters: ["html"],
|
||||
filter_modules: ~r/^Elixir.Smokestack/,
|
||||
source_url_pattern:
|
||||
"https://code.harton.nz/james/smokestack/src/branch/main/%{path}#L%{line}",
|
||||
"https://harton.dev/james/smokestack/src/branch/main/%{path}#L%{line}",
|
||||
spark: [
|
||||
extensions: [
|
||||
%{
|
||||
|
@ -38,7 +38,30 @@ defmodule Smokestack.MixProject do
|
|||
type: "Smokestack"
|
||||
}
|
||||
]
|
||||
]
|
||||
],
|
||||
extras:
|
||||
Enum.concat(
|
||||
["README.md", "CHANGELOG.md"],
|
||||
Path.wildcard("documentation/**/*.{md,livemd,cheatmd}")
|
||||
),
|
||||
groups_for_extras:
|
||||
"documentation/*"
|
||||
|> Path.wildcard()
|
||||
|> Enum.map(fn dir ->
|
||||
name =
|
||||
dir
|
||||
|> Path.split()
|
||||
|> List.last()
|
||||
|> String.split(~r/_+/)
|
||||
|> Enum.map_join(" ", &String.capitalize/1)
|
||||
|
||||
files =
|
||||
dir
|
||||
|> Path.join("**.{md,livemd,cheatmd}")
|
||||
|> Path.wildcard()
|
||||
|
||||
{name, files}
|
||||
end)
|
||||
]
|
||||
]
|
||||
end
|
||||
|
@ -50,10 +73,12 @@ defmodule Smokestack.MixProject do
|
|||
maintainers: ["James Harton <james@harton.nz>"],
|
||||
licenses: ["HL3-FULL"],
|
||||
links: %{
|
||||
"Source" => "https://code.harton.nz/james/smokestack",
|
||||
"Github Mirror" => "https://github.com/jimsynz/smokestack"
|
||||
"Source" => "https://harton.dev/james/smokestack",
|
||||
"Github Mirror" => "https://github.com/jimsynz/smokestack",
|
||||
"Changelog" => "https://docs.harton.nz/james/smokestack/changelog.html",
|
||||
"Sponsor" => "https://github.com/sponsors/jimsynz"
|
||||
},
|
||||
source_url: "https://code.harton.nz/james/smokestack"
|
||||
source_url: "https://harton.dev/james/smokestack"
|
||||
]
|
||||
end
|
||||
|
||||
|
@ -73,13 +98,13 @@ defmodule Smokestack.MixProject do
|
|||
{:dialyxir, "~> 1.3", opts},
|
||||
{:doctor, "~> 0.21", opts},
|
||||
{:earmark, ">= 0.0.0", opts},
|
||||
{:ex_check, "~> 0.15", opts},
|
||||
{:ex_check, "~> 0.16", opts},
|
||||
{:ex_doc, ">= 0.0.0", opts},
|
||||
{:faker, "~> 0.17", opts},
|
||||
{:faker, "~> 0.18", opts},
|
||||
{:git_ops, "~> 2.6", opts},
|
||||
{:mix_audit, "~> 2.1", opts},
|
||||
{:recase, "~> 0.7"},
|
||||
{:spark, "~> 1.1 and >= 1.1.39"}
|
||||
{:spark, "< 3.0.0"}
|
||||
]
|
||||
end
|
||||
|
||||
|
|
34
mix.lock
34
mix.lock
|
@ -1,34 +1,34 @@
|
|||
%{
|
||||
"ash": {:hex, :ash, "2.14.1", "6155726db368b7e3d13087a5178fd3b3464a5db8fe52bc9b1c1be79bd5366c15", [:mix], [{:comparable, "~> 1.0", [hex: :comparable, repo: "hexpm", optional: false]}, {:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:earmark, "~> 1.4", [hex: :earmark, repo: "hexpm", optional: true]}, {:ecto, "~> 3.7", [hex: :ecto, repo: "hexpm", optional: false]}, {:ets, "~> 0.8.0", [hex: :ets, repo: "hexpm", optional: false]}, {:jason, ">= 1.0.0", [hex: :jason, repo: "hexpm", optional: false]}, {:picosat_elixir, "~> 0.2", [hex: :picosat_elixir, repo: "hexpm", optional: false]}, {:plug, ">= 0.0.0", [hex: :plug, repo: "hexpm", optional: true]}, {:spark, ">= 1.1.20 and < 2.0.0-0", [hex: :spark, repo: "hexpm", optional: false]}, {:stream_data, "~> 0.5.0", [hex: :stream_data, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.1", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "6f43e19c53a6239d474ae813842b613405d477f29d2aef2d24d3ae2f5711b392"},
|
||||
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
|
||||
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
|
||||
"comparable": {:hex, :comparable, "1.0.0", "bb669e91cedd14ae9937053e5bcbc3c52bb2f22422611f43b6e38367d94a495f", [:mix], [{:typable, "~> 0.1", [hex: :typable, repo: "hexpm", optional: false]}], "hexpm", "277c11eeb1cd726e7cd41c6c199e7e52fa16ee6830b45ad4cdc62e51f62eb60c"},
|
||||
"credo": {:hex, :credo, "1.7.0", "6119bee47272e85995598ee04f2ebbed3e947678dee048d10b5feca139435f75", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "6839fcf63d1f0d1c0f450abc8564a57c43d644077ab96f2934563e68b8a769d7"},
|
||||
"credo": {:hex, :credo, "1.7.5", "643213503b1c766ec0496d828c90c424471ea54da77c8a168c725686377b9545", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "f799e9b5cd1891577d8c773d245668aa74a2fcd15eb277f51a0131690ebfb3fd"},
|
||||
"decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"},
|
||||
"dialyxir": {:hex, :dialyxir, "1.3.0", "fd1672f0922b7648ff9ce7b1b26fcf0ef56dda964a459892ad15f6b4410b5284", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "00b2a4bcd6aa8db9dcb0b38c1225b7277dca9bc370b6438715667071a304696f"},
|
||||
"dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"},
|
||||
"doctor": {:hex, :doctor, "0.21.0", "20ef89355c67778e206225fe74913e96141c4d001cb04efdeba1a2a9704f1ab5", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm", "a227831daa79784eb24cdeedfa403c46a4cb7d0eab0e31232ec654314447e4e0"},
|
||||
"earmark": {:hex, :earmark, "1.4.39", "acdb2f02c536471029dbcc509fbd6b94b89f40ad7729fb3f68f4b6944843f01d", [:mix], [{:earmark_parser, "~> 1.4.33", [hex: :earmark_parser, repo: "hexpm", optional: false]}], "hexpm", "156c9d8ec3cbeccdbf26216d8247bdeeacc8c76b4d9eee7554be2f1b623ea440"},
|
||||
"earmark_parser": {:hex, :earmark_parser, "1.4.33", "3c3fd9673bb5dcc9edc28dd90f50c87ce506d1f71b70e3de69aa8154bc695d44", [:mix], [], "hexpm", "2d526833729b59b9fdb85785078697c72ac5e5066350663e5be6a1182da61b8f"},
|
||||
"earmark": {:hex, :earmark, "1.4.46", "8c7287bd3137e99d26ae4643e5b7ef2129a260e3dcf41f251750cb4563c8fb81", [:mix], [], "hexpm", "798d86db3d79964e759ddc0c077d5eb254968ed426399fbf5a62de2b5ff8910a"},
|
||||
"earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"},
|
||||
"ecto": {:hex, :ecto, "3.10.3", "eb2ae2eecd210b4eb8bece1217b297ad4ff824b4384c0e3fdd28aaf96edd6135", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "44bec74e2364d491d70f7e42cd0d690922659d329f6465e89feb8a34e8cd3433"},
|
||||
"elixir_make": {:hex, :elixir_make, "0.7.7", "7128c60c2476019ed978210c245badf08b03dbec4f24d05790ef791da11aa17c", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}], "hexpm", "5bc19fff950fad52bbe5f211b12db9ec82c6b34a9647da0c2224b8b8464c7e6c"},
|
||||
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
|
||||
"ets": {:hex, :ets, "0.8.1", "8ff9bcda5682b98493f8878fc9dbd990e48d566cba8cce59f7c2a78130da29ea", [:mix], [], "hexpm", "6be41b50adb5bc5c43626f25ea2d0af1f4a242fb3fad8d53f0c67c20b78915cc"},
|
||||
"ex_check": {:hex, :ex_check, "0.15.0", "074b94c02de11c37bba1ca82ae5cc4926e6ccee862e57a485b6ba60fca2d8dc1", [:mix], [], "hexpm", "33848031a0c7e4209c3b4369ce154019788b5219956220c35ca5474299fb6a0e"},
|
||||
"ex_doc": {:hex, :ex_doc, "0.30.4", "e8395c8e3c007321abb30a334f9f7c0858d80949af298302daf77553468c0c39", [:mix], [{:earmark_parser, "~> 1.4.31", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "9a19f0c50ffaa02435668f5242f2b2a61d46b541ebf326884505dfd3dd7af5e4"},
|
||||
"faker": {:hex, :faker, "0.17.0", "671019d0652f63aefd8723b72167ecdb284baf7d47ad3a82a15e9b8a6df5d1fa", [:mix], [], "hexpm", "a7d4ad84a93fd25c5f5303510753789fc2433ff241bf3b4144d3f6f291658a6a"},
|
||||
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
|
||||
"ex_check": {:hex, :ex_check, "0.16.0", "07615bef493c5b8d12d5119de3914274277299c6483989e52b0f6b8358a26b5f", [:mix], [], "hexpm", "4d809b72a18d405514dda4809257d8e665ae7cf37a7aee3be6b74a34dec310f5"},
|
||||
"ex_doc": {:hex, :ex_doc, "0.31.2", "8b06d0a5ac69e1a54df35519c951f1f44a7b7ca9a5bb7a260cd8a174d6322ece", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.1", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "317346c14febaba9ca40fd97b5b5919f7751fb85d399cc8e7e8872049f37e0af"},
|
||||
"faker": {:hex, :faker, "0.18.0", "943e479319a22ea4e8e39e8e076b81c02827d9302f3d32726c5bf82f430e6e14", [:mix], [], "hexpm", "bfbdd83958d78e2788e99ec9317c4816e651ad05e24cfd1196ce5db5b3e81797"},
|
||||
"file_system": {:hex, :file_system, "1.0.0", "b689cc7dcee665f774de94b5a832e578bd7963c8e637ef940cd44327db7de2cd", [:mix], [], "hexpm", "6752092d66aec5a10e662aefeed8ddb9531d79db0bc145bb8c40325ca1d8536d"},
|
||||
"git_cli": {:hex, :git_cli, "0.3.0", "a5422f9b95c99483385b976f5d43f7e8233283a47cda13533d7c16131cb14df5", [:mix], [], "hexpm", "78cb952f4c86a41f4d3511f1d3ecb28edb268e3a7df278de2faa1bd4672eaf9b"},
|
||||
"git_ops": {:hex, :git_ops, "2.6.0", "e0791ee1cf5db03f2c61b7ebd70e2e95cba2bb9b9793011f26609f22c0900087", [:mix], [{:git_cli, "~> 0.2", [hex: :git_cli, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "b98fca849b18aaf490f4ac7d1dd8c6c469b0cc3e6632562d366cab095e666ffe"},
|
||||
"jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"},
|
||||
"makeup": {:hex, :makeup, "1.1.0", "6b67c8bc2882a6b6a445859952a602afc1a41c2e08379ca057c0f525366fc3ca", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "0a45ed501f4a8897f580eabf99a2e5234ea3e75a4373c8a52824f6e873be57a6"},
|
||||
"makeup_elixir": {:hex, :makeup_elixir, "0.16.1", "cc9e3ca312f1cfeccc572b37a09980287e243648108384b97ff2b76e505c3555", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "e127a341ad1b209bd80f7bd1620a15693a9908ed780c3b763bccf7d200c767c6"},
|
||||
"makeup_erlang": {:hex, :makeup_erlang, "0.1.2", "ad87296a092a46e03b7e9b0be7631ddcf64c790fa68a9ef5323b6cbb36affc72", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "f3f5a1ca93ce6e092d92b6d9c049bcda58a3b617a8d888f8e7231c85630e8108"},
|
||||
"mix_audit": {:hex, :mix_audit, "2.1.1", "653aa6d8f291fc4b017aa82bdb79a4017903902ebba57960ef199cbbc8c008a1", [:make, :mix], [{:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:yaml_elixir, "~> 2.9", [hex: :yaml_elixir, repo: "hexpm", optional: false]}], "hexpm", "541990c3ab3a7bb8c4aaa2ce2732a4ae160ad6237e5dcd5ad1564f4f85354db1"},
|
||||
"nimble_options": {:hex, :nimble_options, "1.0.2", "92098a74df0072ff37d0c12ace58574d26880e522c22801437151a159392270e", [:mix], [], "hexpm", "fd12a8db2021036ce12a309f26f564ec367373265b53e25403f0ee697380f1b8"},
|
||||
"nimble_parsec": {:hex, :nimble_parsec, "1.3.1", "2c54013ecf170e249e9291ed0a62e5832f70a476c61da16f6aac6dca0189f2af", [:mix], [], "hexpm", "2682e3c0b2eb58d90c6375fc0cc30bc7be06f365bf72608804fb9cffa5e1b167"},
|
||||
"makeup": {:hex, :makeup, "1.1.1", "fa0bc768698053b2b3869fa8a62616501ff9d11a562f3ce39580d60860c3a55e", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "5dc62fbdd0de44de194898b6710692490be74baa02d9d108bc29f007783b0b48"},
|
||||
"makeup_elixir": {:hex, :makeup_elixir, "0.16.2", "627e84b8e8bf22e60a2579dad15067c755531fea049ae26ef1020cad58fe9578", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "41193978704763f6bbe6cc2758b84909e62984c7752b3784bd3c218bb341706b"},
|
||||
"makeup_erlang": {:hex, :makeup_erlang, "0.1.5", "e0ff5a7c708dda34311f7522a8758e23bfcd7d8d8068dc312b5eb41c6fd76eba", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "94d2e986428585a21516d7d7149781480013c56e30c6a233534bedf38867a59a"},
|
||||
"mix_audit": {:hex, :mix_audit, "2.1.3", "c70983d5cab5dca923f9a6efe559abfb4ec3f8e87762f02bab00fa4106d17eda", [:make, :mix], [{:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:yaml_elixir, "~> 2.9", [hex: :yaml_elixir, repo: "hexpm", optional: false]}], "hexpm", "8c3987100b23099aea2f2df0af4d296701efd031affb08d0746b2be9e35988ec"},
|
||||
"nimble_options": {:hex, :nimble_options, "1.1.0", "3b31a57ede9cb1502071fade751ab0c7b8dbe75a9a4c2b5bbb0943a690b63172", [:mix], [], "hexpm", "8bbbb3941af3ca9acc7835f5655ea062111c9c27bcac53e004460dfd19008a99"},
|
||||
"nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"},
|
||||
"picosat_elixir": {:hex, :picosat_elixir, "0.2.3", "bf326d0f179fbb3b706bb2c15fbc367dacfa2517157d090fdfc32edae004c597", [:make, :mix], [{:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "f76c9db2dec9d2561ffaa9be35f65403d53e984e8cd99c832383b7ab78c16c66"},
|
||||
"recase": {:hex, :recase, "0.7.0", "3f2f719f0886c7a3b7fe469058ec539cb7bbe0023604ae3bce920e186305e5ae", [:mix], [], "hexpm", "36f5756a9f552f4a94b54a695870e32f4e72d5fad9c25e61bc4a3151c08a4e0c"},
|
||||
"sourceror": {:hex, :sourceror, "0.14.0", "b6b8552d0240400d66b6f107c1bab7ac1726e998efc797f178b7b517e928e314", [:mix], [], "hexpm", "809c71270ad48092d40bbe251a133e49ae229433ce103f762a2373b7a10a8d8b"},
|
||||
"spark": {:hex, :spark, "1.1.39", "f143b84a5b796bf2d83ec8fb4793ee9e66e67510c40d785f9a67050bb88e7677", [:mix], [{:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.5 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:sourceror, "~> 0.1", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "d71bc26014c7e7abcdcf553f4cf7c5a5ff96f8365b1e20be3768ce503aafb203"},
|
||||
"sourceror": {:hex, :sourceror, "1.0.2", "c5e86fdc14881f797749d1fe5df017ca66727a8146e7ee3e736605a3df78f3e6", [:mix], [], "hexpm", "832335e87d0913658f129d58b2a7dc0490ddd4487b02de6d85bca0169ec2bd79"},
|
||||
"spark": {:hex, :spark, "1.1.55", "d20c3f899b23d841add29edc912ffab4463d3bb801bc73448738631389291d2e", [:mix], [{:jason, "~> 1.4", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.5 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:sourceror, "~> 1.0", [hex: :sourceror, repo: "hexpm", optional: false]}], "hexpm", "bbc15a4223d8e610c81ceca825d5d0bae3738d1c4ac4dbb1061749966776c3f1"},
|
||||
"stream_data": {:hex, :stream_data, "0.5.0", "b27641e58941685c75b353577dc602c9d2c12292dd84babf506c2033cd97893e", [:mix], [], "hexpm", "012bd2eec069ada4db3411f9115ccafa38540a3c78c4c0349f151fc761b9e271"},
|
||||
"telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"},
|
||||
"typable": {:hex, :typable, "0.3.0", "0431e121d124cd26f312123e313d2689b9a5322b15add65d424c07779eaa3ca1", [:mix], [], "hexpm", "880a0797752da1a4c508ac48f94711e04c86156f498065a83d160eef945858f8"},
|
||||
|
|
|
@ -83,4 +83,27 @@ defmodule Smokestack.DslTest do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
test "factories can be used" do
|
||||
defmodule UsableFactory do
|
||||
@moduledoc false
|
||||
use Smokestack
|
||||
|
||||
factory Post do
|
||||
attribute :title, &Faker.Company.catch_phrase/0
|
||||
end
|
||||
end
|
||||
|
||||
defmodule FactoryUser do
|
||||
@moduledoc false
|
||||
use UsableFactory
|
||||
|
||||
def test do
|
||||
insert!(Post)
|
||||
end
|
||||
end
|
||||
|
||||
assert %Post{title: title} = FactoryUser.test()
|
||||
assert title =~ ~r/[a-z]+/i
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue