{"id":34252019,"url":"https://github.com/rick-de-water/should","last_synced_at":"2025-12-16T10:57:31.612Z","repository":{"id":147935499,"uuid":"614117109","full_name":"rick-de-water/should","owner":"rick-de-water","description":"Postfix assertion library for Rust","archived":false,"fork":false,"pushed_at":"2024-11-29T15:58:13.000Z","size":44,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-29T20:16:54.229Z","etag":null,"topics":["rust","testing"],"latest_commit_sha":null,"homepage":"https://docs.rs/should","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/rick-de-water.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":"2023-03-14T23:34:34.000Z","updated_at":"2024-11-29T15:55:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"38d46d16-a85e-45e8-b176-3d2f9822e19a","html_url":"https://github.com/rick-de-water/should","commit_stats":null,"previous_names":["rick-de-water/should","should-rs/should"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/rick-de-water/should","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rick-de-water%2Fshould","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rick-de-water%2Fshould/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rick-de-water%2Fshould/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rick-de-water%2Fshould/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rick-de-water","download_url":"https://codeload.github.com/rick-de-water/should/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rick-de-water%2Fshould/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27763281,"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-12-16T02:00:10.477Z","response_time":57,"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":["rust","testing"],"created_at":"2025-12-16T10:57:30.937Z","updated_at":"2025-12-16T10:57:31.598Z","avatar_url":"https://github.com/rick-de-water.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# should\n[![crates.io](https://img.shields.io/crates/v/should)](https://crates.io/crates/should)\n[![docs](https://img.shields.io/docsrs/should)](https://docs.rs/should)\n[![msrv](https://img.shields.io/crates/msrv/should)](https://docs.rs/should)\n\nshould is a postfix assertion library for Rust, heavily inspired by [Shouldly](https://docs.shouldly.org/). It aims to make writing assertions feel more natural, while also providing clearer error messages.\n\n## Example\n\n```rust\nuse should::*;\n\nfn multiply(x: i32, y: i32) -\u003e i32 {\n    x + y // Oh no a bug!\n}\n\n#[test]\nfn test_multiply() {\n    multiply(3, 5).should_be(15);\n}\n```\n\n\u003e panicked at 'multiply(3, 5) should be 15 but was 8'\n\n## Assertions\nImplemented for `T: PartialEq` as well as `Ok(T)` and `Some(T)`\n - `should_be`\n - `should_not_be`\n\nImplemented for `T: PartialOrd` as well as `Ok(T)` and `Some(T)`\n - `should_be_lt`\n - `should_be_le`\n - `should_be_gt`\n - `should_be_ge`\n\nImplemented for `Option\u003cT\u003e`\n - `should_be_some`\n - `should_be_none`\n\nImplemented for `Result\u003cT, E\u003e`\n - `should_be_ok`\n - `should_be_err`\n\nImplemented for `str`\n - `should_start_with`\n - `should_not_start_with`\n - `should_end_with`\n - `should_not_end_with`\n\n Implemented for `T: IntoIterator`\n - `should_be_empty`\n - `should_not_be_empty`\n\nAll asserted types are required to have implemented the `Debug` trait.\n\n## How does it work?\nshould defines a set of assertion traits, which it implements generically for most types. This is what enables the postfix syntax.\n\nWhen the assertion fails, should uses a stacktrace to reconstruct the original expression. It finds the file and line where should was called, parses the original expression, and uses that information to generate a nice panic message.\n\nThis does however mean that builds without debug symbols (e.g. release build by default) are not able to retrieve the expression. A placeholder will be used for the expression when this is the case, and everything else should still work as expected.\n\n## License\nLicensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT) at your option.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frick-de-water%2Fshould","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frick-de-water%2Fshould","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frick-de-water%2Fshould/lists"}