{"id":15393887,"url":"https://github.com/mitchellh/minitest-funcarg","last_synced_at":"2025-05-04T14:20:13.118Z","repository":{"id":1668207,"uuid":"2394965","full_name":"mitchellh/minitest-funcarg","owner":"mitchellh","description":"Proof of concept showing funcargs (style of DI) in minitest.","archived":false,"fork":false,"pushed_at":"2011-09-15T19:56:35.000Z","size":92,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-26T03:34:36.410Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitchellh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-09-15T19:56:25.000Z","updated_at":"2019-11-09T02:36:12.000Z","dependencies_parsed_at":"2022-09-16T22:41:17.146Z","dependency_job_id":null,"html_url":"https://github.com/mitchellh/minitest-funcarg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fminitest-funcarg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fminitest-funcarg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fminitest-funcarg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fminitest-funcarg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitchellh","download_url":"https://codeload.github.com/mitchellh/minitest-funcarg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252345304,"owners_count":21733088,"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-10-01T15:20:40.549Z","updated_at":"2025-05-04T14:20:13.086Z","avatar_url":"https://github.com/mitchellh.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# minitest-funcarg\n\nThis is an extension to [minitest](https://github.com/seattlerb/minitest)\nwhich adds the ability to use funcargs as a method of test-level isolation.\nFuncargs are a form of [dependency injection](http://en.wikipedia.org/wiki/Dependency_injection).\n\n**WARNING:** This is a _proof of concept_. It works, but is not intended --\nin its current form -- to be used for production tests.\n\n## Example\n\n### Defining And Using Funcargs\n\nDefine a test class:\n\n```ruby\nrequire \"minitest/autorun\"\nrequire \"minitest/unit\"\nrequire \"minitest/funcarg\"\n\nclass MyTest \u003c MiniTest::Unit::TestCase\n  def minitest_funcarg__number\n    return 7\n  end\n\n  def test_things(number)\n    assert number \u003e 0\n  end\nend\n```\n\nRun them:\n\n    $ ruby my_test.rb\n    Started\n    .\n    Finished in 0.000343 seconds.\n\n    1 tests, 1 assertions, 0 failures, 0 errors, 0 skips\n\nThe result is that the `number` parameter for `test_things` was given\nas the number 7 since that is what the magic method\n`minitest_funcarg__number` returned.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitchellh%2Fminitest-funcarg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitchellh%2Fminitest-funcarg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitchellh%2Fminitest-funcarg/lists"}