Merge pull request #441 from robstoll/cleanup-elementsOf-specs

add test for empty iterable for contains.inOrder.only.elementsOf
This commit is contained in:
Robert Stoll
2020-04-14 10:29:48 +02:00
committed by GitHub
6 changed files with 24 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ import org.spekframework.spek2.style.specification.describe
class IterableContainsInAnyOrderAtLeast1ElementsOfAssertionsSpec : Spek({
include(BuilderSpec)
describe("elementsOf") {
describe("contains.inAnyOrder.atLeast(1).elementsOf") {
it("passing an empty iterable throws an IllegalArgumentException") {
expect {
expect(listOf(1, 2)).contains.inAnyOrder.atLeast(1).elementsOf(listOf())

View File

@@ -8,7 +8,7 @@ import org.spekframework.spek2.style.specification.describe
class IterableContainsInAnyOrderOnlyElementsOfAssertionSpec : Spek({
include(BuilderSpec)
describe("elementsOf") {
describe("contains.inAnyOrder.only.elementsOf") {
it("passing an empty iterable throws an IllegalArgumentException") {
expect {
expect(listOf(1, 2)).contains.inAnyOrder.only.elementsOf(listOf())

View File

@@ -1,10 +1,20 @@
package ch.tutteli.atrium.api.fluent.en_GB
import ch.tutteli.atrium.api.verbs.internal.expect
import ch.tutteli.atrium.creating.Expect
import org.spekframework.spek2.Spek
import org.spekframework.spek2.style.specification.describe
class IterableContainsInOrderOnlyElementsOfAssertionSpec : Spek({
include(BuilderSpec)
describe("contains.inOrder.only.elementsOf") {
it("passing an empty iterable throws an IllegalArgumentException") {
expect {
expect(listOf(1, 2)).contains.inOrder.only.elementsOf(listOf())
}.toThrow<IllegalArgumentException>()
}
}
}) {
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableContainsInOrderOnlyValuesAssertionsSpec(
getContainsPair(),

View File

@@ -8,7 +8,7 @@ import org.spekframework.spek2.style.specification.describe
class IterableContainsInAnyOrderAtLeast1ElementsOfAssertionsSpec : Spek({
include(BuilderSpec)
describe("elementsOf") {
describe("contains o inAny order atLeast 1 elementsOf") {
it("passing an empty iterable throws an IllegalArgumentException") {
expect {
expect(listOf(1, 2)) contains o inAny order atLeast 1 elementsOf listOf()

View File

@@ -8,7 +8,7 @@ import org.spekframework.spek2.style.specification.describe
class IterableContainsInAnyOrderOnlyElementsOfAssertionSpec : Spek({
include(BuilderSpec)
describe("elementsOf") {
describe("contains o inAny order but only elementsOf") {
it("passing an empty iterable throws an IllegalArgumentException") {
expect {
expect(listOf(1, 2)) contains o inAny order but only elementsOf listOf()

View File

@@ -1,10 +1,20 @@
package ch.tutteli.atrium.api.infix.en_GB
import ch.tutteli.atrium.api.verbs.internal.expect
import ch.tutteli.atrium.creating.Expect
import org.spekframework.spek2.Spek
import org.spekframework.spek2.style.specification.describe
class IterableContainsInOrderOnlyElementsOfAssertionSpec : Spek({
include(BuilderSpec)
describe("contains o inGiven order and only elementsOf") {
it("passing an empty iterable throws an IllegalArgumentException") {
expect {
expect(listOf(1, 2)) contains o inGiven order and only elementsOf listOf()
}.toThrow<IllegalArgumentException>()
}
}
}) {
object BuilderSpec : ch.tutteli.atrium.specs.integration.IterableContainsInOrderOnlyValuesAssertionsSpec(
getContainsPair(),