{"id":13521218,"url":"https://github.com/frodsan/mocoso","last_synced_at":"2025-08-20T05:31:03.254Z","repository":{"id":56884183,"uuid":"13232655","full_name":"frodsan/mocoso","owner":"frodsan","description":"A minimalist stub \u0026 mock library","archived":false,"fork":false,"pushed_at":"2016-05-02T22:32:16.000Z","size":60,"stargazers_count":15,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-17T04:28:01.257Z","etag":null,"topics":["minimalist","mock","ruby","stub"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/frodsan.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":"2013-10-01T02:09:09.000Z","updated_at":"2021-03-08T11:43:36.000Z","dependencies_parsed_at":"2022-08-20T22:31:10.866Z","dependency_job_id":null,"html_url":"https://github.com/frodsan/mocoso","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frodsan%2Fmocoso","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frodsan%2Fmocoso/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frodsan%2Fmocoso/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frodsan%2Fmocoso/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frodsan","download_url":"https://codeload.github.com/frodsan/mocoso/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230367731,"owners_count":18215323,"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":["minimalist","mock","ruby","stub"],"created_at":"2024-08-01T06:00:30.993Z","updated_at":"2024-12-19T07:11:07.085Z","avatar_url":"https://github.com/frodsan.png","language":"Ruby","funding_links":[],"categories":["Mocks"],"sub_categories":[],"readme":"Mocoso [![Build Status](https://travis-ci.org/frodsan/mocoso.svg)](https://travis-ci.org/frodsan/mocoso)\n======\n\nYet Another Simple Stub \u0026 Mock library. This is inspired by\n[Minitest::Mock][minitest] and [Override][override].\n\nDescription\n-----------\n\nMocoso meets the following criteria:\n\n* Simplicity.\n* Always restore stubbed methods to their original implementations.\n* Doesn't allow to stub or mock undefined methods.\n* Doesn't monkey-patch any class or object.\n* Test-framework agnostic. No integration code.\n\nInstallation\n------------\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"mocoso\"\n```\n\nAnd then execute:\n\n```\n$ bundle\n```\n\nOr install it yourself as:\n\n```\n$ gem install mocoso\n```\n\nUsage\n-----\n\nA quick example (uses [Cutest][cutest]):\n\n```ruby\nrequire \"cutest\"\nrequire \"mocoso\"\n\ninclude Mocoso\n\ntest \"mocking a class method\" do\n  user = User.new\n\n  expect(User, :find, with: [1], return: user) do\n    assert_equal user, User.find(1)\n  end\n\n  assert_equal nil, User.find(1)\nend\n\ntest \"stubbing an instance method\" do\n  user = User.new\n\n  stub(user, :valid?, true) do\n    assert user.valid?\n  end\n\n  assert !user.valid?\nend\n```\n\nCheck [Official Documentation][docs] for more details.\n\nContributing\n------------\n\nFork the project with:\n\n```\n$ git clone git@github.com:frodsan/mocoso.git\n```\n\nTo install dependencies, use:\n\n```\n$ bundle install\n```\n\nTo run the test suite, do:\n\n```\n$ rake test\n```\n\nFor bug reports and pull requests use [GitHub][issues].\n\nLicense\n-------\n\nMocoso is released under the [MIT License][mit].\n\n[docs]: http://rubydoc.info/github/harmoni/mocoso/\n[cutest]: https://github.com/djanowski/cutest/\n[issues]: https://github.com/frodsan/mocoso/issues\n[minitest]: https://github.com/seattlerb/minitest/\n[mit]: http://www.opensource.org/licenses/MIT\n[override]: https://github.com/soveran/override/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrodsan%2Fmocoso","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrodsan%2Fmocoso","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrodsan%2Fmocoso/lists"}