{"id":18099966,"url":"https://github.com/rossmacarthur/goldie","last_synced_at":"2025-04-13T16:09:15.154Z","repository":{"id":45786532,"uuid":"412907116","full_name":"rossmacarthur/goldie","owner":"rossmacarthur","description":"🌟 Simple golden file testing for Rust","archived":false,"fork":false,"pushed_at":"2024-04-21T15:34:02.000Z","size":55,"stargazers_count":6,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"trunk","last_synced_at":"2025-04-13T16:09:08.787Z","etag":null,"topics":["crate","golden","rust","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/rossmacarthur.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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}},"created_at":"2021-10-02T20:40:53.000Z","updated_at":"2024-04-21T15:33:52.000Z","dependencies_parsed_at":"2024-10-31T21:12:03.414Z","dependency_job_id":null,"html_url":"https://github.com/rossmacarthur/goldie","commit_stats":{"total_commits":28,"total_committers":1,"mean_commits":28.0,"dds":0.0,"last_synced_commit":"92980547ab94f611721619fa0a0f4d41a4ece77e"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rossmacarthur%2Fgoldie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rossmacarthur%2Fgoldie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rossmacarthur%2Fgoldie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rossmacarthur%2Fgoldie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rossmacarthur","download_url":"https://codeload.github.com/rossmacarthur/goldie/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248741204,"owners_count":21154255,"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":["crate","golden","rust","testing"],"created_at":"2024-10-31T21:11:58.549Z","updated_at":"2025-04-13T16:09:15.123Z","avatar_url":"https://github.com/rossmacarthur.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- Generated by cargo-onedoc. DO NOT EDIT. --\u003e\n\n# goldie\n\n[![Crates.io Version](https://badgers.space/crates/version/goldie)](https://crates.io/crates/goldie)\n[![Docs.rs Latest](https://badgers.space/badge/docs.rs/latest/blue)](https://docs.rs/goldie)\n[![Build Status](https://badgers.space/github/checks/rossmacarthur/goldie?label=build)](https://github.com/rossmacarthur/goldie/actions/workflows/build.yaml)\n\nSimple golden file testing for Rust.\n\n\n```text\ngoldie::assert!(text);\n```\n\n## 🚀 Getting started\n\nAdd `goldie` to your project as a dev dependency.\n\n```sh\ncargo add goldie --dev\n```\n\nIn your test function assert the contents using `goldie::assert!`. The golden\nfilename will be automatically determined based on the test file and test\nfunction name. Run tests with `GOLDIE_UPDATE=true` to automatically update\ngolden files.\n\n```rust,no_run\n#[test]\nfn example() {\n    let text = { /* ... run the test ... */ };\n\n    // assert that the contents of ./testdata/example.golden\n    // are equal to `text`\n    goldie::assert!(text)\n}\n```\n\nTemplated golden files are also supported using `goldie::assert_template!`.\nSomething implementing `serde::Serialize` needs to be provided as context in\norder to render the template. Values are rendered using\n[upon](https://github.com/rossmacarthur/upon) e.g. `{{ value.field }}`.\nYou cannot use  `GOLDIE_UPDATE=true` to automatically update templated golden\nfiles.\n\n```rust,no_run\n#[test]\nfn example() {\n    let text = { /* ... run the test ... */ };\n\n    // assert that the contents of ./testdata/example.golden\n    // are equal to `text` after rendering with `ctx`.\n    let ctx = upon::value!{ value: \"Hello World!\" };\n    goldie::assert_template!(\u0026ctx, text)\n}\n```\n\n## License\n\nThis project is distributed under the terms of both the MIT license and the Apache License (Version 2.0).\n\nSee [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frossmacarthur%2Fgoldie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frossmacarthur%2Fgoldie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frossmacarthur%2Fgoldie/lists"}