{"id":13509184,"url":"https://github.com/obmarg/ex_unit_fixtures","last_synced_at":"2025-07-04T08:36:42.506Z","repository":{"id":62429491,"uuid":"48513932","full_name":"obmarg/ex_unit_fixtures","owner":"obmarg","description":"A library for defining modular dependencies (fixtures) for ExUnit tests.","archived":false,"fork":false,"pushed_at":"2024-01-19T21:43:40.000Z","size":98,"stargazers_count":13,"open_issues_count":15,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-12T00:06:21.798Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/obmarg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-12-23T22:37:09.000Z","updated_at":"2024-03-04T02:55:10.000Z","dependencies_parsed_at":"2024-01-31T07:53:43.738Z","dependency_job_id":null,"html_url":"https://github.com/obmarg/ex_unit_fixtures","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obmarg%2Fex_unit_fixtures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obmarg%2Fex_unit_fixtures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obmarg%2Fex_unit_fixtures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obmarg%2Fex_unit_fixtures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/obmarg","download_url":"https://codeload.github.com/obmarg/ex_unit_fixtures/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221665169,"owners_count":16860187,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T02:01:04.201Z","updated_at":"2024-10-27T10:49:09.980Z","avatar_url":"https://github.com/obmarg.png","language":"Elixir","funding_links":[],"categories":["Testing"],"sub_categories":[],"readme":"# ExUnitFixtures\n\nA library for defining modular dependencies (fixtures) for ExUnit tests.\n\n#### What are Fixtures?\n\nFixtures in ExUnitFixtures are just functions that are run before a test.\n\nThey can be used to setup the tests environment somehow, or provide the test\nwith some data that it requires. Similar in purpose to `setup` \u0026 `setup_all` but\nmore powerful:\n\n- Tests explicitly list what fixtures they require, ensuring that no\n  un-neccesary setup work is done.\n- Fixtures may be shared across many tests in a project.\n- Fixtures may depend on or override other fixtures, allowing core fixtures to\n  be used \u0026 customised as each subsystem or test module requires.\n\n## Installation\n\n  1. Add ex_unit_fixtures to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:ex_unit_fixtures, \"~\u003e 0.3.1\", only: [:test]}]\nend\n```\n\n## Documentation\n\nThe documentation can be found on hexdocs.pm:\nhttp://hexdocs.pm/ex_unit_fixtures/ExUnitFixtures.html\n\n## Example\n\nSay some of your tests required a model named `my_model`. You should define a\nfixture fixture using `deffixture`, then tag your test to say it requires this\nfixture:\n\n```elixir\ndefmodule MyTests do\n  use ExUnitFixtures\n  use ExUnit.Case\n  ExUnit.Case.register_attribute __MODULE__, :fixtures\n\n  deffixture my_model do\n    # Create a model somehow...\n    %{test: 1}\n  end\n\n  @fixtures: :my_model\n  test \"that we have some fixtures\", context do\n    assert context.my_model.test == 1\n  end\nend\n```\n\nMore details can be found in\n[the documentation](http://hexdocs.pm/ex_unit_fixtures/ExUnitFixtures.html).\n\n\n### Examples in the wild.\n\n- [Vassal](https://github.com/obmarg/vassal) makes use of ExUnitFixtures in\n  it's integration tests.\n- I have played around with converting the tests for\n  [Sqlitex](https://github.com/obmarg/sqlitex/tree/ex_unit_fixtures) to use\n  ExUnitFixtures.  (This hasn't been PRd, it's just another example).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobmarg%2Fex_unit_fixtures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobmarg%2Fex_unit_fixtures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobmarg%2Fex_unit_fixtures/lists"}