{"id":29675782,"url":"https://github.com/oxidecomputer/expectorate","last_synced_at":"2025-07-22T23:38:44.447Z","repository":{"id":42085161,"uuid":"285639161","full_name":"oxidecomputer/expectorate","owner":"oxidecomputer","description":"I'm especially good at expectorating","archived":false,"fork":false,"pushed_at":"2025-06-30T02:44:43.000Z","size":498,"stargazers_count":29,"open_issues_count":4,"forks_count":3,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-07-14T00:09:46.176Z","etag":null,"topics":[],"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/oxidecomputer.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,"governance":null}},"created_at":"2020-08-06T18:08:28.000Z","updated_at":"2025-05-26T06:40:33.000Z","dependencies_parsed_at":"2023-02-10T00:50:35.676Z","dependency_job_id":null,"html_url":"https://github.com/oxidecomputer/expectorate","commit_stats":{"total_commits":24,"total_committers":7,"mean_commits":"3.4285714285714284","dds":"0.33333333333333337","last_synced_commit":"ed78905356cfc75ba89f96d3d9e9e14d016af80e"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/oxidecomputer/expectorate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidecomputer%2Fexpectorate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidecomputer%2Fexpectorate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidecomputer%2Fexpectorate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidecomputer%2Fexpectorate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oxidecomputer","download_url":"https://codeload.github.com/oxidecomputer/expectorate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oxidecomputer%2Fexpectorate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266591233,"owners_count":23953082,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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-07-22T23:38:37.035Z","updated_at":"2025-07-22T23:38:44.436Z","avatar_url":"https://github.com/oxidecomputer.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Expectorate\n\nThis is a little library to validate expected output saved in files. It makes it easy to update that content when it should be updated to match the new results.\n\n## Validating Output\n\nSay you have a function `compose()` that produces a string and you have a file named `lyrics.txt` that contain the expected output. You can compare the actual output like this:\n\n```rust\n    let actual: \u0026str = compose();\n    assert_content(\"lyrics.txt\", actual);\n```\n\nIf the output doesn't match, you'll see output like this:\n\n![](screenshots/expectorate.png)\n\nWhite means that the content matches. Red means that content from the file was missing. Green means that content not in the file was added.\n\nIf we want to accept the changes from `compose()` we'd simply run with `EXPECTORATE=overwrite`. Assuming `lyrics.txt` is checked in, `git diff` will show you something like this:\n\n```diff\ndiff --git a/examples/lyrics.txt b/examples/lyrics.txt\nindex e4104c1..ea6beaf 100644\n--- a/examples/lyrics.txt\n+++ b/examples/lyrics.txt\n@@ -1,5 +1,2 @@\n-No one hits like Gaston\n-Matches wits like Gaston\n-In a spitting match nobody spits like Gaston\n+In a testing match nobody tests like Gaston\n I'm especially good at expectorating\n-Ten points for Gaston\n```\n\n## Predicates (feature: predicates)\n\nExpectorate can be used in places where you might use the [`predicates`\ncrate](https://crates.io/crates/predicates). If you're using\n`predicates::path::eq_file` you can instead use `expectorate::eq_file` or\n`expectorate::eq_file_or_panic`. Populate or update the specified file as\nabove.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxidecomputer%2Fexpectorate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foxidecomputer%2Fexpectorate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxidecomputer%2Fexpectorate/lists"}