{"id":13509182,"url":"https://github.com/drewolson/ex_spec","last_synced_at":"2025-07-04T21:35:57.264Z","repository":{"id":19065103,"uuid":"22291888","full_name":"drewolson/ex_spec","owner":"drewolson","description":"BDD-like syntax for ExUnit","archived":false,"fork":false,"pushed_at":"2018-06-06T13:36:56.000Z","size":29,"stargazers_count":99,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-15T18:05:36.444Z","etag":null,"topics":["elixir","exunit","hex"],"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/drewolson.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-26T17:19:15.000Z","updated_at":"2024-05-08T21:57:49.000Z","dependencies_parsed_at":"2022-09-26T22:10:16.002Z","dependency_job_id":null,"html_url":"https://github.com/drewolson/ex_spec","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/drewolson/ex_spec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewolson%2Fex_spec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewolson%2Fex_spec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewolson%2Fex_spec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewolson%2Fex_spec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drewolson","download_url":"https://codeload.github.com/drewolson/ex_spec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drewolson%2Fex_spec/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263624835,"owners_count":23490568,"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":["elixir","exunit","hex"],"created_at":"2024-08-01T02:01:04.169Z","updated_at":"2025-07-04T21:35:57.225Z","avatar_url":"https://github.com/drewolson.png","language":"Elixir","funding_links":[],"categories":["Testing"],"sub_categories":[],"readme":"## ExSpec\n\n[![Build Status](https://travis-ci.org/drewolson/ex_spec.svg)](https://travis-ci.org/drewolson/ex_spec) [![Hex Version](http://img.shields.io/hexpm/v/ex_spec.svg?style=flat)](https://hex.pm/packages/ex_spec) [![Hex docs](http://img.shields.io/badge/hex.pm-docs-green.svg?style=flat)](https://hexdocs.pm/ex_spec)\n\nExSpec is a simple wrapper around ExUnit that adds Rspec-style macros. Specifically, it adds `context` and `it`.\n\nWhile it takes inspiration from Rspec, ExSpec is significantly simplier. The `context` macro has only two functions:\n\n1. Aid test organization\n2. Prepend to the message of any `it` defined within its do blocks\n\nThe `it` macro is identical to `ExUnit.Case.test` except that it is aware of the messages of its surrounding `context` blocks. It also works seemlessly with `ExUnit`'s `describe` function.\n\nOther than the functionality described above, ExSpec is just ExUnit. When `use`ing `ExSpec`, any options provided will be passed to `ExUnit.Case` (e.g. `async: true`).\n\nA simple example is shown below. For more examples, see the tests.\n\n### Example\n\n```elixir\ndefmodule PersonTest do\n  use ExSpec, async: true\n\n  describe \"name\" do\n    context \"with first and last name\" do\n      it \"joins the names with a space\" do\n        drew = %Person{first_name: \"Drew\", last_name: \"Olson\"}\n\n        assert Person.name(drew) == \"Drew Olson\"\n      end\n    end\n\n    context \"with only a first name\" do\n      it \"returns the first name\" do\n        drew = %Person{first_name: \"Drew\", last_name: nil}\n\n        assert Person.name(drew) == \"Drew\"\n      end\n    end\n  end\nend\n```\n\n### Installation\n\nAdd `ex_spec` to your `mix.exs` dependencies:\n\n```elixir\ndef deps do\n  [{:ex_spec, \"~\u003e 2.0\", only: :test}]\nend\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrewolson%2Fex_spec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrewolson%2Fex_spec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrewolson%2Fex_spec/lists"}