{"id":13463367,"url":"https://github.com/rr/rr","last_synced_at":"2026-02-20T12:33:40.781Z","repository":{"id":7607035,"uuid":"8964987","full_name":"rr/rr","owner":"rr","description":"RR is a test double framework that features a rich selection of double techniques and a terse syntax. ⛺","archived":false,"fork":false,"pushed_at":"2025-11-22T12:38:46.000Z","size":2557,"stargazers_count":324,"open_issues_count":25,"forks_count":30,"subscribers_count":11,"default_branch":"main","last_synced_at":"2026-02-15T09:21:19.016Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://rr.github.io/rr","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/rr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2013-03-23T02:57:33.000Z","updated_at":"2026-02-13T12:11:46.000Z","dependencies_parsed_at":"2025-03-25T06:32:08.220Z","dependency_job_id":"27141cd2-92f3-4629-ae9b-4961cadc81d7","html_url":"https://github.com/rr/rr","commit_stats":null,"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"purl":"pkg:github/rr/rr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rr%2Frr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rr%2Frr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rr%2Frr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rr%2Frr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rr","download_url":"https://codeload.github.com/rr/rr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rr%2Frr/sbom","scorecard":{"id":786503,"data":{"date":"2025-08-11","repo":{"name":"github.com/rr/rr","commit":"a19e81094837c950563c5d380d6e6cb76b3ecf83"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4,"checks":[{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":2,"reason":"Found 6/28 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/gh-pages.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/gh-pages.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/rr/rr/gh-pages.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/gh-pages.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/rr/rr/gh-pages.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/gh-pages.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/rr/rr/gh-pages.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/rr/rr/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/rr/rr/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/rr/rr/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/rr/rr/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/rr/rr/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/rr/rr/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/rr/rr/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/rr/rr/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/rr/rr/test.yml/main?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   6 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release.yml:32"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 8 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T06:14:56.664Z","repository_id":7607035,"created_at":"2025-08-23T06:14:56.664Z","updated_at":"2025-08-23T06:14:56.664Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29494795,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T00:16:34.147Z","status":"ssl_error","status_checked_at":"2026-02-16T00:15:26.759Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-07-31T13:00:52.105Z","updated_at":"2026-02-20T12:33:40.749Z","avatar_url":"https://github.com/rr.png","language":"Ruby","readme":"# RR [![Gem Version](https://badge.fury.io/rb/rr.svg)](https://badge.fury.io/rb/rr) [![Build Status](https://travis-ci.org/rr/rr.svg?branch=master)](https://travis-ci.org/rr/rr) [![Code Climate GPA](https://codeclimate.com/github/rr/rr.svg)](https://codeclimate.com/github/rr/rr)\n\nRR is a test double framework for Ruby that features a rich selection of double\ntechniques and a terse syntax.\n\n---\n\n## Learning more\n\n1. [A whirlwind tour of RR](#a-whirlwind-tour-of-rr)\n2. [What is a test double?](doc/01_test_double.md)\n3. [Syntax between RR and other double/mock frameworks](doc/02_syntax_comparison.md)\n4. [API overview - Full listing of DSL methods](doc/03_api_overview.md)\n\n\n## A whirlwind tour of RR\n\n### Stubs\n\n~~~ ruby\n# Stub a method to return nothing\nstub(object).foo\nstub(MyClass).foo\n\n# Stub a method to always return a value\nstub(object).foo { 'bar' }\nstub(MyClass).foo { 'bar' }\n\n# Stub a method to return a value when called with certain arguments\nstub(object).foo(1, 2) { 'bar' }\nstub(MyClass).foo(1, 2) { 'bar' }\n~~~\n\n### Mocks\n\n~~~ ruby\n# Create an expectation on a method\nmock(object).foo\nmock(MyClass).foo\n\n# Create an expectation on a method and stub it to always return a value\nmock(object).foo { 'bar' }\nmock(MyClass).foo { 'bar' }\n\n# Create an expectation on a method with certain arguments and stub it to return\n# a value when called that way\nmock(object).foo(1, 2) { 'bar' }\nmock(MyClass).foo(1, 2) { 'bar' }\n~~~\n\n### Spies\n\n~~~ ruby\n# RSpec\nstub(object).foo\nexpect(object).to have_received.foo\n\n# Test::Unit\nstub(object).foo\nassert_received(object) {|o| o.foo }\n~~~\n\n### Proxies\n\n~~~ ruby\n# Intercept a existing method without completely overriding it, and create a\n# new return value from the existing one\nstub.proxy(object).foo {|str| str.upcase }\nstub.proxy(MyClass).foo {|str| str.upcase }\n\n# Do the same thing except also create an expectation\nmock.proxy(object).foo {|str| str.upcase }\nmock.proxy(MyClass).foo {|str| str.upcase }\n\n# Intercept a class's new method and define a double on the return value\nstub.proxy(MyClass).new {|obj| stub(obj).foo; obj }\n\n# Do the same thing except also create an expectation on .new\nmock.proxy(MyClass).new {|obj| stub(obj).foo; obj }\n~~~\n\n### Class instances\n\n~~~ ruby\n# Stub a method on an instance of MyClass when it is created\nany_instance_of(MyClass) do |klass|\n  stub(klass).foo { 'bar' }\nend\n\n# Another way to do this which gives you access to the instance itself\nstub.proxy(MyClass).new do |obj|\n  stub(obj).foo { 'bar' }\nend\n~~~\n\n\n## Installing RR into your project\n\nNOTE: If you want to use RR with\n[test-unit](https://test-unit.github.io/), use\n[test-unit-rr](https://test-unit.github.io/#test-unit-rr). You don't\nneed to read the following subsections.\n\nFor minimal setup, RR looks for an existing test framework and then hooks itself\ninto it. Hence, RR works best when loaded *after* the test framework that you\nare using is loaded.\n\nIf you are using Bundler, you can achieve this by specifying the dependency on\nRR with `require: false`; then, require RR directly following your test\nframework.\n\nHere's what this looks like for different kinds of projects:\n\n### Ruby project (without Bundler)\n\n~~~ ruby\nrequire 'your/test/framework'\nrequire 'rr'\n~~~\n\n### Ruby project (with Bundler)\n\n~~~ ruby\n# Gemfile\ngem 'rr', require: false\n\n# test helper\nrequire 'your/test/framework'\nrequire 'rr'\n~~~\n\n### Rails project\n\n~~~ ruby\n# Gemfile\ngroup :test do\n  gem 'rr', require: false\nend\n\n# test helper\nrequire File.expand_path('../../config/environment', __FILE__)\nrequire 'your/test/framework'  # if you are using something other than MiniTest / Test::Unit\nrequire 'rr'\n~~~\n\n## Compatibility\n\nRR is designed and tested to work against the following Ruby versions:\n\n* 2.4\n* 2.5\n* 2.6\n* 2.7\n* 3.0\n* JRuby 1.7.4\n\nas well as the following test frameworks:\n\n* Test::Unit via [test-unit-rr](https://test-unit.github.io/#test-unit-rr)\n* RSpec 2\n* MiniTest 4\n* Minitest 5\n\n## Help!\n\nIf you have a question or are having trouble, simply [post it as an\nissue](https://github.com/rr/rr/issues) and I'll respond as soon as I can.\n\n\n## Contributing\n\nWant to contribute a bug fix or new feature to RR? Great! Follow these steps:\n\n1. Make sure you have a recent Ruby (check the compatibility table above).\n2. Clone the repo (you probably knew that already).\n3. Make a new branch off of `master` with a descriptive name.\n4. Work on your patch.\n5. Run `bundle install`.\n6. Ensure all of the tests pass by running `bundle exec rake`.\n7. If you want to go the extra mile, install the other Ruby versions listed\n   above in the compatibility table, and repeat steps 5-6. See the \"Running test\n   suites\" section below for more information.\n8. When you're done, push your branch and create a pull request from it.\n   I'll respond as soon as I can.\n\n### Running tests\n\nAs indicated by the compatibility list above, in order to test support for\nmultiple Ruby versions and environments, there are multiple test suites, and\nRake tasks to run these suites. The list of available Rake tasks depends on\nwhich version of Ruby you are under, but you can get the full list with:\n\n    bundle exec rake -D spec:\n\nTo run all the suites, simply say:\n\n    bundle exec rake\n\n(Incidentally, this is also the command which Travis runs.)\n\n\n## Author/Contact\n\nRR was originally written by Brian Takita. And it was maintained by\nElliot Winkler (\u003celliot.winkler@gmail.com\u003e). It is currently\nmaintained by Kouhei Sutou (\u003ckou@cozmixng.org\u003e).\n\n\n## Credits\n\nWith any development effort, there are countless people who have contributed to\nmaking it possible; RR is no exception! [You can read the full list of\ncredits here](CREDITS.md).\n\n\n## License\n\nRR is available under the [MIT license](LICENSE).\n","funding_links":[],"categories":["Testing"],"sub_categories":["Mocking"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frr%2Frr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frr%2Frr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frr%2Frr/lists"}