-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from IvanAtanasov89/master
Added backtick functions for shouldContainSame
- Loading branch information
Showing
4 changed files
with
56 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
jvm/src/test/kotlin/org/amshove/kluent/tests/backtickassertions/ShouldContainSameTests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package org.amshove.kluent.tests.backtickassertions | ||
|
||
import org.amshove.kluent.`should contain same` | ||
import org.jetbrains.spek.api.Spek | ||
import kotlin.test.assertFails | ||
|
||
class ShouldContainSameTests : Spek({ | ||
given("the shouldContainSame method") { | ||
on("testing a list which contains all the same elements") { | ||
it("should pass") { | ||
val cities = listOf("Israel", "Berlin", "Phoenix") | ||
val actual = listOf("Israel", "Phoenix", "Berlin") | ||
|
||
actual `should contain same` cities | ||
} | ||
} | ||
on("testing a short array which contains all the same elements") { | ||
it("should pass") { | ||
val numbers = shortArrayOf(1, 2, 3) | ||
val actual = shortArrayOf(1, 3, 2) | ||
|
||
actual `should contain same` numbers | ||
} | ||
} | ||
on("testing a list which contains only 2 of the 3 elements") { | ||
it("should pass") { | ||
val cities = listOf("Israel", "Berlin", "Phoenix") | ||
val actual = listOf("Israel", "Berlin", "Liverpool") | ||
|
||
assertFails { actual `should contain same` cities } | ||
} | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters