Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Remove mockito and all related features #136

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,6 @@ val list = listOf(alice, jon)
list shouldContain jon
```

### Stubbing

```kotlin
val stub = mock(Database::class)
val bob = Person("Bob", "Guy")
When calling stub.getPerson() itReturns bob
```

## Using backticks

Every method that is included in Kluent also has a "backtick version", to make it feel more like a describing sentence.
Expand Down
207 changes: 103 additions & 104 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,104 +1,103 @@
buildscript {
// TODO: Mockito and Spek will be removed in the future
ext.mockito_version = '1.5.0'
ext.spek_version = "1.0.+"
repositories {
jcenter()
mavenCentral()
maven { url "http://kotlin.bintray.com/kotlinx" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.moowork.gradle:gradle-node-plugin:$gradle_node_version"
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:$kotlin_version"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.+"
}
}

ext {
libs = [
// Compile
kotlin_stdlib_common : "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version",
kotlin_stdlib_jvm : "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version",
kotlin_stdlib_js : "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version",
kotlin_reflect : "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version",

// Tests
kotlin_test_common : "org.jetbrains.kotlin:kotlin-test-common:$kotlin_version",
kotlin_test_jvm : "org.jetbrains.kotlin:kotlin-test:$kotlin_version",
kotlin_test_junit : "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version",
kotlin_test_js : "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version",
kotlin_test_annotations : "org.jetbrains.kotlin:kotlin-test-annotations-common:$kotlin_version",

junit : "junit:junit:4.12",
]
}

allprojects {
group 'org.amshove.kluent'
version '1.47'

repositories {
jcenter()
mavenCentral()
maven { url "http://kotlin.bintray.com/kotlinx" }
// TODO: To be removed (only used for Spek)
maven { url = 'http://repository.jetbrains.com/all' }
}

tasks.withType(Test) {
testLogging {
showStandardStreams = true
events "passed", "failed"
}
}
}

subprojects {
ext.configurePublishing = { artifactName = null ->
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
apply plugin: 'java'

artifactName = artifactName ?: project.name
println "artifactName: $artifactName"

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

artifacts {
archives sourcesJar
}

bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
publish = true
override = true
publications = ['Publication']
configurations = ['archives']
pkg {
repo = 'maven'
name = artifactName
licenses = ['MIT']
vcsUrl = 'https://github.com/MarkusAmshove/Kluent'
}

publishing {
publications {
Publication(MavenPublication) {
from components.java
groupId 'org.amshove.kluent'
artifactId artifactName
version project.version
artifact sourcesJar
}
}
}
}
}
}
buildscript {
// TODO: Mockito and Spek will be removed in the future
ext.spek_version = "1.0.+"
repositories {
jcenter()
mavenCentral()
maven { url "http://kotlin.bintray.com/kotlinx" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.moowork.gradle:gradle-node-plugin:$gradle_node_version"
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:$kotlin_version"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.+"
}
}

ext {
libs = [
// Compile
kotlin_stdlib_common : "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version",
kotlin_stdlib_jvm : "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version",
kotlin_stdlib_js : "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version",
kotlin_reflect : "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version",

// Tests
kotlin_test_common : "org.jetbrains.kotlin:kotlin-test-common:$kotlin_version",
kotlin_test_jvm : "org.jetbrains.kotlin:kotlin-test:$kotlin_version",
kotlin_test_junit : "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version",
kotlin_test_js : "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version",
kotlin_test_annotations : "org.jetbrains.kotlin:kotlin-test-annotations-common:$kotlin_version",

junit : "junit:junit:4.12",
]
}

allprojects {
group 'org.amshove.kluent'
version '1.47'

repositories {
jcenter()
mavenCentral()
maven { url "http://kotlin.bintray.com/kotlinx" }
// TODO: To be removed (only used for Spek)
maven { url = 'http://repository.jetbrains.com/all' }
}

tasks.withType(Test) {
testLogging {
showStandardStreams = true
events "passed", "failed"
}
}
}

subprojects {
ext.configurePublishing = { artifactName = null ->
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven-publish'
apply plugin: 'java'

artifactName = artifactName ?: project.name
println "artifactName: $artifactName"

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

artifacts {
archives sourcesJar
}

bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
publish = true
override = true
publications = ['Publication']
configurations = ['archives']
pkg {
repo = 'maven'
name = artifactName
licenses = ['MIT']
vcsUrl = 'https://github.com/MarkusAmshove/Kluent'
}

publishing {
publications {
Publication(MavenPublication) {
from components.java
groupId 'org.amshove.kluent'
artifactId artifactName
version project.version
artifact sourcesJar
}
}
}
}
}
}
61 changes: 0 additions & 61 deletions docs/Mocking.md

This file was deleted.

4 changes: 1 addition & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Kluent is a "Fluent Assertions" library written specifically for Kotlin.

It uses the [Infix-Notations](https://kotlinlang.org/docs/reference/functions.html#infix-notation "Infix-Notation") and [Extension Functions](https://kotlinlang.org/docs/reference/extensions.html#extension-functions "Extension Functions") of Kotlin to provide a fluent wrapper around JUnit-Asserts and Mockito.
It uses the [Infix-Notations](https://kotlinlang.org/docs/reference/functions.html#infix-notation "Infix-Notation") and [Extension Functions](https://kotlinlang.org/docs/reference/extensions.html#extension-functions "Extension Functions") of Kotlin to provide a fluent wrapper around JUnit-Asserts.

[How to contribute](../CONTRIBUTING.md)

Expand All @@ -28,8 +28,6 @@ It uses the [Infix-Notations](https://kotlinlang.org/docs/reference/functions.ht

[Exception handling](Exceptions.md)

[Mocking](Mocking.md)

[java.time Assertions](JavaTime.md)

[FileSystem](FileSystem.md)
Expand Down
5 changes: 0 additions & 5 deletions jvm/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ if(isAndroid) {
def artifactName = isAndroid ? 'kluent-android' : 'kluent'
configurePublishing(artifactName)

def mockito_kotlin_version = "2.0.0"

dependencies {
expectedBy project(':kluent-common')
implementation libs.kotlin_stdlib_jvm
Expand All @@ -21,12 +19,9 @@ dependencies {
testImplementation libs.kotlin_test_jvm
testImplementation libs.kotlin_test_junit


// TODO: To be removed
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this? Is this related only to Mockito and Spek?

implementation libs.junit
implementation "com.nhaarman.mockitokotlin2:mockito-kotlin:$mockito_kotlin_version"
testImplementation "org.jetbrains.spek:spek:$spek_version"
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:$mockito_kotlin_version"
}

sourceSets {
Expand Down
Loading