{"id":15568313,"url":"https://github.com/cfcosta/minitest-firemock","last_synced_at":"2025-04-24T00:09:21.808Z","repository":{"id":71883755,"uuid":"2540224","full_name":"cfcosta/minitest-firemock","owner":"cfcosta","description":"Makes your MiniTest mocks more resilient.","archived":false,"fork":false,"pushed_at":"2015-04-23T04:14:56.000Z","size":257,"stargazers_count":31,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-24T00:09:14.458Z","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/cfcosta.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-10-08T22:01:22.000Z","updated_at":"2025-01-26T11:23:28.000Z","dependencies_parsed_at":"2023-02-23T08:45:10.597Z","dependency_job_id":null,"html_url":"https://github.com/cfcosta/minitest-firemock","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfcosta%2Fminitest-firemock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfcosta%2Fminitest-firemock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfcosta%2Fminitest-firemock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfcosta%2Fminitest-firemock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cfcosta","download_url":"https://codeload.github.com/cfcosta/minitest-firemock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250535102,"owners_count":21446508,"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-02T17:14:59.343Z","updated_at":"2025-04-24T00:09:21.788Z","avatar_url":"https://github.com/cfcosta.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"MiniTest::FireMock\n==================\n\nThis gem was designed do make isolated tests more resilient. In isolated tests, a FireMock is no different than a common mock. The only difference is when the test is called on a not-isolated environment. It checks for the presence of the method on the mocked class, and fails if it isn't there. This adds another layer of security for suit tests, without compromising the isolation of unit tests.\n\nIt's based on the awesome [rspec-fire](https://github.com/xaviershay/rspec-fire) from [Xavier Shay](http://xaviershay.com/).\n\n[![Build Status](https://travis-ci.org/cfcosta/minitest-firemock.svg?branch=master)](https://travis-ci.org/cfcosta/minitest-firemock)\n\nUsage\n-----\n\n```ruby\nrequire 'minitest/autorun'\nrequire 'minitest/fire_mock'\n\nclass MyClass\n  def my_method\n    # actual_work goes here\n  end\nend\n\nclass MyOtherClassTest \u003c MiniTest::Unit::TestCase\n  def test_for_correctness\n    mock = MiniTest::FireMock.new('MyClass')\n    mock.expect(:my_method, 42)\n    assert_equal 42, mock.my_method\n    mock.verify\n  end\nend\n```\n\nThe only real difference of using `MiniTest::FireMock` instead of `MiniTest::Mock` is that if `MyClass` is defined, and `my_method` isn't there, it'll raise a `MockExpectationError`. It checks also for the arity of the method, so it'll raise a `MockExpectationError` if the real method have a different arity than the expectation.\n\nTODO\n----\n\n- Mock class/module methods too.\n- Make it work with method_missing (as of now it doesn't, even if the #responds_to? is correct)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfcosta%2Fminitest-firemock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcfcosta%2Fminitest-firemock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfcosta%2Fminitest-firemock/lists"}