{"id":33938573,"url":"https://github.com/google/assertor","last_synced_at":"2026-04-01T20:44:23.665Z","repository":{"id":57497699,"uuid":"403690160","full_name":"google/assertor","owner":"google","description":"Fluent assertion library for Rust with readable messages.","archived":false,"fork":false,"pushed_at":"2026-03-27T18:03:38.000Z","size":188,"stargazers_count":149,"open_issues_count":7,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-03-29T13:38:12.896Z","etag":null,"topics":["assert","assertions","rust-library","testing"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2021-09-06T16:27:28.000Z","updated_at":"2026-03-03T20:32:56.000Z","dependencies_parsed_at":"2023-02-09T11:16:15.081Z","dependency_job_id":"ed6f45d0-e455-4483-bb21-220b92b33dfb","html_url":"https://github.com/google/assertor","commit_stats":{"total_commits":45,"total_committers":2,"mean_commits":22.5,"dds":0.0888888888888889,"last_synced_commit":"80c2307bdc95adb7d6358b7a06234ec99520dfa1"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/google/assertor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fassertor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fassertor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fassertor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fassertor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/assertor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fassertor/sbom","scorecard":{"id":490337,"data":{"date":"2025-08-12T22:46:10Z","repo":{"name":"github.com/google/assertor","commit":"8cb376ca4f07c1582ecc97ccea35b4a82a8c174d"},"scorecard":{"version":"v5.2.1","commit":"ab2f6e92482462fe66246d9e32f642855a691dc1"},"score":6.9,"checks":[{"name":"Code-Review","score":1,"reason":"Found 1/10 approved changesets -- score normalized to 1","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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#code-review"}},{"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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#dangerous-workflow"}},{"name":"Dependency-Update-Tool","score":10,"reason":"update tool detected","details":["Info: detected update tool: Dependabot: .github/dependabot.yml:1"],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#dependency-update-tool"}},{"name":"Pinned-Dependencies","score":6,"reason":"dependency not pinned by hash detected -- score normalized to 6","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/google/assertor/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/google/assertor/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/google/assertor/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/google/assertor/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/scorecard.yml:35: update your workflow using https://app.stepsecurity.io/secureworkflow/google/assertor/scorecard.yml/master?enable=pin","Info:   2 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   3 out of   4 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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#pinned-dependencies"}},{"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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":5,"reason":"7 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Warn: jobLevel 'checks' permission set to 'write': .github/workflows/ci.yml:24","Info: jobLevel 'contents' permission set to 'read': .github/workflows/ci.yml:23","Info: topLevel permissions set to 'read-all': .github/workflows/ci.yml:13","Info: topLevel permissions set to 'read-all': .github/workflows/publish.yml:7","Info: topLevel permissions set to 'read-all': .github/workflows/scorecard.yml:18"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#token-permissions"}},{"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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#vulnerabilities"}},{"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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#cii-best-practices"}},{"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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#sast"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#license"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/google/.github/SECURITY.md:1","Info: Found linked content: github.com/google/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/google/.github/SECURITY.md:1","Info: Found text in security policy: github.com/google/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#security-policy"}},{"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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#fuzzing"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish.yml:13"],"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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#packaging"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#branch-protection"}},{"name":"Contributors","score":0,"reason":"project has 0 contributing companies or organizations -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project has a set of contributors from multiple organizations (e.g., companies).","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#contributors"}},{"name":"CI-Tests","score":9,"reason":"28 out of 30 merged PRs checked by a CI test -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project runs tests before pull requests are merged.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#ci-tests"}}]},"last_synced_at":"2025-08-19T18:58:02.375Z","repository_id":57497699,"created_at":"2025-08-19T18:58:02.375Z","updated_at":"2025-08-19T18:58:02.375Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291782,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: 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":["assert","assertions","rust-library","testing"],"created_at":"2025-12-12T15:02:24.285Z","updated_at":"2026-04-01T20:44:23.655Z","avatar_url":"https://github.com/google.png","language":"Rust","readme":"Assertor\n========\nAssertor makes test assertions and failure messages more human-readable.\n\n[![crates.io](https://img.shields.io/crates/v/assertor.svg)](https://crates.io/crates/assertor)\n[![license](https://img.shields.io/github/license/google/assertor.svg)](https://github.com/google/assertor/LICENSE)\n[![docs.rs](https://docs.rs/assertor/badge.svg)](https://docs.rs/crate/assertor/)\n[![OpenSSF\nScorecard](https://api.securityscorecards.dev/projects/github.com/google/assertor/badge)](https://api.securityscorecards.dev/projects/github.com/google/assertor)\n\nAssertor is heavily affected by [Java Truth](https://github.com/google/truth) in terms of API design and error messages,\nbut this is a totally different project from Java Truth.\n\n### Disclaimer\n\nThis is not an official Google product, it is just code that happens to be owned by Google.\n\n⚠ The API is not fully stable and may be changed until version 1.0.\n\nExample\n-------\n\n```rust\nuse assertor::*;\n\n#[test]\nfn test_it() {\n    assert_that!(\"foobarbaz\").contains(\"bar\");\n    assert_that!(\"foobarbaz\").ends_with(\"baz\");\n\n    assert_that!(0.5).with_abs_tol(0.2).is_approx_equal_to(0.6);\n\n    assert_that!(vec![\"a\", \"b\"]).contains(\"a\");\n    assert_that!(vec![\"a\", \"b\"]).has_length(2);\n    assert_that!(vec![\"a\", \"b\"]).contains_exactly(vec![\"a\", \"b\"]);\n\n    assert_that!(Option::Some(\"Foo\")).has_value(\"Foo\");\n}\n```\n\n### Failure cases\n\n```rust\nuse assertor::*;\n\nfn test_it() {\n    assert_that!(vec![\"a\", \"b\", \"c\"]).contains_exactly(vec![\"b\", \"c\", \"d\"]);\n    // missing (1)   : [\"d\"]\n    // unexpected (1): [\"a\"]\n    // ---\n    // expected      : [\"b\", \"c\", \"d\"]\n    // actual        : [\"a\", \"b\", \"c\"]\n}\n```\n\n## anyhow\n\nSupports asserting error value of `anyhow` under `anyhow` feature flag.\n\n```toml\n[dependencies]\nassertor = { version = \"*\", features = [\"anyhow\"] }\n```\n\n```rust\nuse assertor::*;\nuse anyhow::anyhow;\n\nfn anyhow_func() -\u003e anyhow::Result\u003c()\u003e {\n    Err(anyhow!(\"failed to parse something in foobar\"))\n}\n\nfn test_it() {\n    assert_that!(anyhow_func()).err().has_message(\"failed to parse something in foobar\");\n    assert_that!(anyhow_func()).err().as_string().contains(\"parse something\");\n    assert_that!(anyhow_func()).err().as_string().starts_with(\"failed\");\n    assert_that!(anyhow_func()).err().as_string().ends_with(\"foobar\");\n}\n```\n\n## Feature ideas\n\n- [ ] Color / Bold\n- [ ] Better diff: vec\n- [ ] Better diff: set\n- [ ] Better diff: HashMap\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fassertor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fassertor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fassertor/lists"}