{"id":25776403,"url":"https://github.com/pholser/lambspec","last_synced_at":"2025-12-24T22:35:39.179Z","repository":{"id":13836747,"uuid":"16533660","full_name":"pholser/lambspec","owner":"pholser","description":"RSpec-like assertion library for Java \u003e= 8","archived":false,"fork":false,"pushed_at":"2016-02-06T21:45:23.000Z","size":136,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-16T10:23:26.220Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pholser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-05T03:12:05.000Z","updated_at":"2024-03-31T14:14:31.000Z","dependencies_parsed_at":"2022-09-06T14:11:38.428Z","dependency_job_id":null,"html_url":"https://github.com/pholser/lambspec","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pholser%2Flambspec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pholser%2Flambspec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pholser%2Flambspec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pholser%2Flambspec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pholser","download_url":"https://codeload.github.com/pholser/lambspec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240987434,"owners_count":19889333,"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":[],"created_at":"2025-02-27T06:01:23.154Z","updated_at":"2025-12-24T22:35:39.171Z","avatar_url":"https://github.com/pholser.png","language":"Java","funding_links":[],"categories":["测试"],"sub_categories":[],"readme":"# lambspec\n\nAssertion library for Java \u003e= 8\n\n\n## Downloading\n\nAccessible from Maven central. Coordinates: `com.pholser:lambspec-{module}:{version}`.\nYou will need at minimum `lambspec-core`.\n\n\n## Examples\n\nThe best place to begin exploring is in test class\n[ExpectationsTest](https://github.com/pholser/lambspec/blob/master/core/src/test/java/com/pholser/lambspec/ExpectationsTest.java).\n\nJavadoc is [here](http://pholser.github.io/lambspec/).\n\n\n## Features\n\n* [RSpec](http://rspec.info/)-like syntax for nominating test subjects\nand specifying expectations on them:\n\n    `expect(\"foo\").to(s -\u003e s.startsWith(\"f\"));`\n\n* Uses [predicates](http://download.java.net/jdk8/docs/api/java/util/function/Predicate.html)\nas the means for specifying expectations on test subjects. `Predicate` is a\n[functional interface](http://download.java.net/jdk8/docs/api/java/lang/FunctionalInterface.html),\nso you can use lambda expressions and method references to specify the\nexpectations more succinctly and sweetly.\n\n* Optional: Adapters for [Hamcrest](http://hamcrest.org/JavaHamcrest/)\nmatchers and [Guava](https://code.google.com/p/guava-libraries/) predicates.\n\n* Optional: Similar syntax for establishing\n[assumptions](https://github.com/junit-team/junit/wiki/Assumptions-with-assume)\nfor [JUnit theories](http://junit.org).\n\n\n## Caveats\n\nWhen an expectation or assumption is not met, the raised exception's message will\ncontain the `toString()` of the expectation. A lambda expression's `toString()`\nis not terribly pretty or helpful. If evocative assertion error messages are\nimportant to you, you may want to create implementations of `Predicate`,\nanonymous or otherwise, and override `toString()` to your liking.\n\n## About\n\nlambspec was written by Paul Holser, and is distributed under the MIT License.\n\n    The MIT License\n\n    Copyright (c) 2014-2016 Paul R. Holser, Jr.\n\n    Permission is hereby granted, free of charge, to any person obtaining\n    a copy of this software and associated documentation files (the\n    \"Software\"), to deal in the Software without restriction, including\n    without limitation the rights to use, copy, modify, merge, publish,\n    distribute, sublicense, and/or sell copies of the Software, and to\n    permit persons to whom the Software is furnished to do so, subject to\n    the following conditions:\n\n    The above copyright notice and this permission notice shall be\n    included in all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n    LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n    OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n    WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpholser%2Flambspec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpholser%2Flambspec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpholser%2Flambspec/lists"}