{"id":17557741,"url":"https://github.com/splattael/minitest-around","last_synced_at":"2025-08-21T04:31:10.042Z","repository":{"id":1996400,"uuid":"2929439","full_name":"splattael/minitest-around","owner":"splattael","description":"Around block for minitest.","archived":false,"fork":false,"pushed_at":"2018-12-02T12:06:02.000Z","size":89,"stargazers_count":41,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-28T03:53:15.895Z","etag":null,"topics":["around","minitest","ruby","spec","testing"],"latest_commit_sha":null,"homepage":"","language":"Gherkin","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/splattael.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2011-12-07T01:23:18.000Z","updated_at":"2023-11-06T14:00:32.000Z","dependencies_parsed_at":"2022-07-25T23:00:08.211Z","dependency_job_id":null,"html_url":"https://github.com/splattael/minitest-around","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/splattael/minitest-around","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splattael%2Fminitest-around","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splattael%2Fminitest-around/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splattael%2Fminitest-around/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splattael%2Fminitest-around/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/splattael","download_url":"https://codeload.github.com/splattael/minitest-around/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/splattael%2Fminitest-around/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271425051,"owners_count":24757397,"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","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["around","minitest","ruby","spec","testing"],"created_at":"2024-10-21T09:24:10.523Z","updated_at":"2025-08-21T04:31:09.742Z","avatar_url":"https://github.com/splattael.png","language":"Gherkin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[github]: https://github.com/splattael/minitest-around\n[doc]: http://rubydoc.info/github/splattael/minitest-around/master/file/README.md\n[gem]: https://rubygems.org/gems/minitest-around\n[travis]: https://travis-ci.org/splattael/minitest-around\n\n# minitest-around\n\n[![Travis](https://img.shields.io/travis/splattael/minitest-around.svg?branch=master)][travis]\n[![Gem Version](https://img.shields.io/gem/v/minitest-around.svg)][gem]\n\n[Gem][gem] |\n[Source][github]\n\nAround block for minitest 5.X.\n\nAlternative for setup/teardown dance.\n\n## Installation\n\n```Bash\ngem install minitest-around\n```\n\n## Usage\n\n### Unit tests\n\n```Ruby\nrequire 'minitest/autorun'\nrequire 'minitest/around/unit'\nrequire 'thread'\n\nclass MutexTest \u003c Minitest::Test\n  def around(\u0026block)\n    Mutex.new.synchronize(\u0026block)\n  end\n\n  def test_synchronized\n    # ...\n  end\nend\n```\n\n### Spec\n\n\u003c!-- example --\u003e\n```Ruby\nrequire 'minitest/autorun'\nrequire 'minitest/around/spec'\nrequire 'tmpdir'\n\ndescribe \"inside new directory\" do\n  around do |test|\n    Dir.mktmpdir do |dir|\n      @dir = dir\n      Dir.chdir(dir) do\n        test.call\n      end\n    end\n  end\n\n  it \"is in new directory\" do\n    assert_equal @dir, Dir.pwd.sub(\"/private/var/\", \"/var/\")\n  end\nend\n```\n\u003c!-- example --\u003e\n\n## Multiple before/after blocks\n\nMinitest-around also enables the use of multiple before/after blocks, which normally don't work in minitest.\n\n## Caveats\n\n - Test bodies won't be run if you don't test.call inside +around+.\n - around runs inside a Fiber, so use `Thread.get_thread_local` / `set_thread_local` instead of `Thread.current.[]`\n\n### Minitest 5.X only\n\n`minitest-around` currently supports only `minitest` 5.X.\n\nPlease see the [mt4](https://github.com/splattael/minitest-around/tree/mt4) branch\nfor `minitest` 4.7.X support.\n\n\n## License\n\n[MIT License](http://www.opensource.org/licenses/mit-license.php)\n\n## Authors\n\n* [Peter Leitzen](https://github.com/splattael)\n\n## [Contributors](https://github.com/splattael/minitest-around/graphs/contributors)\n\n* [Michael Grosser](https://github.com/grosser)\n* [Hendra Uzia](https://github.com/hendrauzia)\n* [Rick Martínez](https://github.com/rickmzp)\n* [Philip Nelson](https://github.com/pnelson)\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## Test\n\n```Bash\nbundle exec rake test\n```\n\n## Release\n\n```Bash\nbundle exec rake bump:{patch|minor|major}\nbundle exec rake release\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsplattael%2Fminitest-around","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsplattael%2Fminitest-around","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsplattael%2Fminitest-around/lists"}