{"id":28509102,"url":"https://github.com/atomicobject/hardmock","last_synced_at":"2025-10-09T03:41:01.515Z","repository":{"id":715651,"uuid":"362631","full_name":"atomicobject/hardmock","owner":"atomicobject","description":"A strict, ordered, expectation-oriented mock object library for testing Ruby code.","archived":false,"fork":false,"pushed_at":"2011-01-09T01:02:00.000Z","size":1736,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-10-07T20:23:14.410Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://atomicobject.github.com/hardmock","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/atomicobject.png","metadata":{"files":{"readme":"README.rdoc","changelog":"CHANGES","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":"2009-11-05T22:56:13.000Z","updated_at":"2013-12-24T17:00:14.000Z","dependencies_parsed_at":"2022-07-07T15:08:22.871Z","dependency_job_id":null,"html_url":"https://github.com/atomicobject/hardmock","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/atomicobject/hardmock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fhardmock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fhardmock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fhardmock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fhardmock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atomicobject","download_url":"https://codeload.github.com/atomicobject/hardmock/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fhardmock/sbom","scorecard":{"id":215216,"data":{"date":"2025-08-11","repo":{"name":"github.com/atomicobject/hardmock","commit":"a2c01c2cbd28f56a71cc824f04b40ea1d14be367"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"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":"Maintained","score":0,"reason":"0 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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"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 'master'"],"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"}}]},"last_synced_at":"2025-08-17T01:32:14.636Z","repository_id":715651,"created_at":"2025-08-17T01:32:14.636Z","updated_at":"2025-08-17T01:32:14.636Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000714,"owners_count":26082911,"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-10-09T02:00:07.460Z","response_time":59,"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":[],"created_at":"2025-06-08T22:07:28.248Z","updated_at":"2025-10-09T03:41:01.497Z","avatar_url":"https://github.com/atomicobject.png","language":"Ruby","readme":"== Hardmock\n\nStrict, ordered mock objects using very lightweight syntax in your tests.\n\n== DISCONTINUED\n\nAfter release 1.3.8, Hardmock will not be actively maintained.\n(1.3.8 is a Ruby 1.9/MiniTest compatibility update, see below).\n\nAtomic Object still believes in (and heavily utilizes) mock objects and interaction-based unit testing, however, we ourselves have begun leveraging other popular mocking tools such as RSpec, RR, Mocha, etc.\n\nFor those of you with time invested in older projects using Hardmock, but who need to migrate their older projects to Ruby 1.9, try updating to Hardmock 1.3.8.\n\n== How to use Hardmock\n\nThe basic procedure for using Hardmock in your tests is:\n\n* require 'hardmock' (this happens automatically when being used as a Rails plugin)\n* Create some mocks\n* Setup some expectations\n* Execute the target code\n* Verification of calls is automatic in =teardown=\n\nThe expectations you set when using mocks are \u003cb\u003estrict\u003c/b\u003e and \u003cb\u003eordered\u003c/b\u003e.\nExpectations you declare by creating and using mocks are all considered together.\n\n* Hardmock::Mock#expects will show you more examples\n* Hardmock::SimpleExpectation will teach you more about expectation methods\n\n== Example\n\n  create_mocks :garage, :car\n\n  # Set some expectations\n  @garage.expects.open_door\n  @car.expects.start(:choke)\n  @car.expects.drive(:reverse, 5.mph)\n\n  # Execute the code (this code is usually, obviously, in your class under test)\n  @garage.open_door  \n  @car.start :choke\n  @car.drive :reverse, 5.mph\n\n  verify_mocks # OPTIONAL, teardown will do this for you\n\nExpects \u003ctt\u003e@garage.open_door\u003c/tt\u003e, \u003ctt\u003e@car.start(:choke)\u003c/tt\u003e and \u003ctt\u003e@car.drive(:reverse, 5.mph)\u003c/tt\u003e to be called in that order, with those specific arguments.\n* Violations of expectations, such as mis-ordered calls, calls on wrong objects, or incorrect methods result in Hardmock::ExpectationError\n* \u003ctt\u003everify_mocks\u003c/tt\u003e will raise VerifyError if not all expectations have been met.\n\n== Download and Install\n\n* Install: gem install hardmock\n* Homepage: http://atomicobject.github.com/hardmock\n* Rubygems.org: http://rubygems.org/gems/hardmock\n* API documentation: http://rubydoc.info/gems/hardmock/frames\n\n== Setup for Test::Unit\n\n  require 'hardmock'\n  require 'assert_error' # OPTIONAL: this adds the TestUnit extension 'assert_error' \n\nNOTE: If installed as a Rails plugin, init.rb does this for you... nothing else is needed.\n\n== Setup for RSpec\n\nGet this into your spec helper or environment or Rakefile or wherever you prefer:\n\n  Spec::Runner.configure do |configuration|\n    configuration.include Hardmock\n    configuration.after(:each) {verify_mocks}\n  end\n\nThis puts the implicit conveniences into your spec context, like \"create_mocks\" etc, and also provides for automatic\n\"verify_mocks\" after each Example is run.\n\n== Ruby 1.9 Compatibility\n\nAs of build 1.3.8, Hardmock works in Ruby 1.9.2.  Older versions of Hardmock had non-1.9 compatible code; furthermore, 1.9 ships with MiniTest, which is similar to TestUnit but has different implementation internals, which we monkey-patch.\n\n== Author\n\n* David Crosby crosby at http://atomicobject.com\n* (c) 2006-2011 Atomic Object LLC \n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomicobject%2Fhardmock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatomicobject%2Fhardmock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomicobject%2Fhardmock/lists"}