Skip to content

Commit

Permalink
Removed confusing and misleading dependency on Path type from tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
npryce committed Jan 6, 2019
1 parent 9917758 commit ad387dd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/test/kotlin/com/natpryce/hamkrest/describe_tests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.natpryce.hamkrest

import com.natpryce.hamkrest.assertion.assertThat
import org.junit.Test
import java.nio.file.Paths

class DelimitingValuesInStrings {
@Test
Expand Down Expand Up @@ -51,10 +50,15 @@ class DelimitingValuesInStrings {
assertThat(describe(d), equalTo("d"))
}

class IterableButNotCollection(private vararg val elements: String) : Iterable<String> {
override fun iterator() = elements.iterator()
override fun toString() = elements.joinToString("/")
}

@Test
fun file_paths() {
val path = Paths.get("/foo/bar/baz")
assertThat(describe(path), equalTo("/foo/bar/baz"))
fun does_not_generate_collectionlike_description_for_iterables_that_are_not_collections() {
val thing = IterableButNotCollection("foo", "bar", "baz")
assertThat(describe(thing), equalTo("foo/bar/baz"))
}
}

Expand Down

0 comments on commit ad387dd

Please sign in to comment.