{"id":13428717,"url":"https://github.com/MarkusAmshove/Kluent","last_synced_at":"2025-03-16T01:33:27.634Z","repository":{"id":43871390,"uuid":"51317191","full_name":"MarkusAmshove/Kluent","owner":"MarkusAmshove","description":"Fluent Assertion-Library for Kotlin","archived":false,"fork":false,"pushed_at":"2023-04-29T13:58:51.000Z","size":1944,"stargazers_count":867,"open_issues_count":14,"forks_count":64,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-10-27T06:38:54.554Z","etag":null,"topics":["fluent-assertions","hacktoberfest","kotlin","testing"],"latest_commit_sha":null,"homepage":"https://markusamshove.github.io/Kluent/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MarkusAmshove.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-02-08T18:27:53.000Z","updated_at":"2024-10-17T13:03:38.000Z","dependencies_parsed_at":"2023-02-13T02:25:19.332Z","dependency_job_id":"4cb5c4d0-85bb-45a2-906d-a936a55f09c9","html_url":"https://github.com/MarkusAmshove/Kluent","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkusAmshove%2FKluent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkusAmshove%2FKluent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkusAmshove%2FKluent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarkusAmshove%2FKluent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarkusAmshove","download_url":"https://codeload.github.com/MarkusAmshove/Kluent/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814905,"owners_count":20352037,"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":["fluent-assertions","hacktoberfest","kotlin","testing"],"created_at":"2024-07-31T01:01:03.416Z","updated_at":"2025-03-16T01:33:27.257Z","avatar_url":"https://github.com/MarkusAmshove.png","language":"Kotlin","funding_links":[],"categories":["Libraries","Kotlin","Unit Test"],"sub_categories":["Library"],"readme":"# Kluent\n\n[![Changelog](https://img.shields.io/badge/docs-changelog-blue.svg)](https://github.com/MarkusAmshove/Kluent/releases)\n[![Documentation](https://img.shields.io/badge/docs-documentation-blue.svg)](https://markusamshove.github.io/Kluent/)\n[![Contributors](https://img.shields.io/badge/docs-contributors-blue.svg)](https://github.com/MarkusAmshove/Kluent/blob/master/AUTHORS.md)\n[![Current version](https://img.shields.io/maven-central/v/org.amshove.kluent/kluent?style=flat-square)](https://mvnrepository.com/artifact/org.amshove.kluent)\n\n[Kluent](https://markusamshove.github.io/Kluent/) is a \"Fluent Assertions\" library written specifically for Kotlin.\n\nIt uses the [Infix-Notations](https://kotlinlang.org/docs/reference/functions.html#infix-notation \"Infix-Notation\")\nand [Extension Functions](https://kotlinlang.org/docs/reference/extensions.html#extension-functions \"Extension Functions\")\nof Kotlin to provide a fluent wrapper around the JUnit-Assertions.\n\n[How to contribute](CONTRIBUTING.md)\n\n----------\n\n# Include it via gradle/maven\n\nKluent is hosted [here at mavenCentral](https://mvnrepository.com/artifact/org.amshove.kluent/kluent)\n\nKluent-Android is hosted [here at mavenCentral](https://mvnrepository.com/artifact/org.amshove.kluent/kluent-android)\n\n## Gradle\n\nReplace {version} with the current version and chose one of the two artifacts, based on your target platform:\n\n```groovy\n// Add jcenter as a repository for dependencies\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    // for JVM:\n    testImplementation 'org.amshove.kluent:kluent:{version}'\n\n    // for Android:\n    testImplementation 'org.amshove.kluent:kluent-android:{version}'\n\n    // To get JUnit errors from kotlin.test, to e.g. enable diff windows in failure messages\n    testImplementation \"org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version\"\n}\n```\n\n## Maven\n\nReplace {version} with the current version\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.amshove.kluent\u003c/groupId\u003e\n    \u003cartifactId\u003ekluent\u003c/artifactId\u003e\n    \u003cversion\u003e{version}\u003c/version\u003e\n    \u003ctype\u003epom\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\n----------\n\n# Examples\n\nMore examples can be seen on the [Site](https://markusamshove.github.io/Kluent/) or in\nthe [tests](https://github.com/MarkusAmshove/Kluent/tree/master/src/test/kotlin/org/amshove/kluent/tests).\n\n### assertEquals ##\n\n```kotlin\n\"hello\" shouldBeEqualTo \"hello\"\n```\n\n### assertNotEquals ##\n\n```kotlin\n\"hello\" shouldNotBeEqualTo \"world\"\n```\n\n### Assert that an Array/Iterable contains something ##\n\n```kotlin\nval alice = Person(\"Alice\", \"Bob\")\nval jon = Person(\"Jon\", \"Doe\")\nval list = listOf(alice, jon)\nlist shouldContain jon\n```\n\n## Using backticks\n\nEvery method that is included in Kluent also has a \"backtick version\", to make it feel more like a describing sentence.\n\nSome examples:\n\n### assertEquals ##\n\n```kotlin\n\"hello\" `should be equal to` \"hello\"\n```\n\n### assertNotEquals ##\n\n```kotlin\n\"hello\" `should not be equal to` \"world\"\n```\n\n# Building Kluent\n\nAll projects of Kluent are built with [Gradle](http://gradle.org/)\n\nThe default `gradlew build` will only build the `common` and `jvm` module, to keep the build times as small as possible.\n\nIf you plan to submit a pull request, it is also fine if you just make sure it builds and tests against `common`\nand `jvm` (which `gradlew build` will make sure of), because the rest of the heavy work will be done by Travis and\nAppVeyor. That way you can keep your machine free from NodeJS and Kotlin Native :-)\n\nTo build the Android library, pass the parameter `ANDROID` to Gradle. This will build the `common` and `android`\nartifacts. To pass the parameter, type:\n\n`gradlew build -PANDROID`\n\nTo also build the JS module, pass `JS`:\n\n`gradlew build -PJS`\n\nTo build native, pass:\n\n`gradlew build -PNATIVE`\n\nIn these cases, the JVM module will also be built, because it is our primary target and everything should pass on the\nJVM. To skip the JVM build, e.g. for testing only against Native or JS, pass `SKIPVM`:\n\n`gradlew build -PJS -PNATIVE -PSKIPJVM`\n\nThis command will build `common`, `js`, `native`, but not `jvm`.\n\n## Where to put new features\n\nIf you plan to add a feature (e.g. an Assertion), it would be nice to first try adding it to the `common` module, as it\nwould then be available to all platforms. If it uses specific APIs, like classes from the Java standard library, then it\nneeds to go to the `jvm` module.\n\nIf you're unsure where to put a feature, or if you want to put something in the `common` module which needs platform\nspecific implementations, you can have a\nlook [here](https://github.com/MarkusAmshove/Kluent/blob/master/common/src/main/kotlin/org/amshove/kluent/Basic.kt) (`platformIsDigit`\nor `platformClassName`)\nwhere a function in the `common` module calls a so called `expect` function, which is\ndefined [here](https://github.com/MarkusAmshove/Kluent/blob/master/common/src/main/kotlin/org/amshove/kluent/internal/Platform.kt)\nin the `common` module and has\nspecific [JVM](https://github.com/MarkusAmshove/Kluent/blob/master/jvm/src/main/kotlin/org/amshove/kluent/internal/Platform.kt)\n,\n[JS](https://github.com/MarkusAmshove/Kluent/blob/master/js/src/main/kotlin/org/amshove/kluent/internal/Platform.kt)\nand [Native](https://github.com/MarkusAmshove/Kluent/blob/master/native/src/main/kotlin/org/amshove/kluent/internal/Platform.kt)\nimplementation.\n\nIf you're still unsure how to make something platform independent, we can have a look together inside the PR :-)\n\n# Attribution\n\n[Parts of the `assertSoftly` feature](https://github.com/MarkusAmshove/Kluent/pull/185#issuecomment-731777949) are based\nupon the great work of [Kotest](https://github.com/kotest/kotest) under the Apache 2.0 License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMarkusAmshove%2FKluent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMarkusAmshove%2FKluent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMarkusAmshove%2FKluent/lists"}