Skip to content

Commit 92ae1a1

Browse files
committed
test: Fix atrium’s deprecations
1 parent 0088372 commit 92ae1a1

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

src/test/kotlin/NotationsTest.kt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package de.joshuagleitze.stringnotation
22

3-
import ch.tutteli.atrium.api.cc.en_GB.property
4-
import ch.tutteli.atrium.api.cc.en_GB.returnValueOf
5-
import ch.tutteli.atrium.api.cc.en_GB.toBe
6-
import ch.tutteli.atrium.verbs.expect
3+
import ch.tutteli.atrium.api.fluent.en_GB.feature
4+
import ch.tutteli.atrium.api.fluent.en_GB.toBe
5+
import ch.tutteli.atrium.api.verbs.expect
76
import org.junit.jupiter.api.TestInstance
87
import org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS
98
import org.junit.jupiter.params.ParameterizedTest
@@ -21,24 +20,24 @@ abstract class BaseNotationTest(
2120
@MethodSource("parseWords")
2221
fun `parses words correctly`(input: String, expectedWord: Word) {
2322
expect(input.fromNotation(notation)) {
24-
property(Word::partsList).toBe(expectedWord.partsList)
23+
feature(Word::partsList).toBe(expectedWord.partsList)
2524
}
2625
}
2726

2827
@ParameterizedTest(name = "{1} -> \"{0}\"")
2928
@MethodSource("printWords")
3029
fun `prints words correctly`(sourceWord: Word, expectedResult: String) {
3130
expect(sourceWord) {
32-
returnValueOf(subject::toNotation, notation).toBe(expectedResult)
31+
feature(Word::toNotation, notation).toBe(expectedResult)
3332
}
3433
}
3534

3635
@ParameterizedTest(name = "\"{0}\"")
3736
@MethodSource("unchangedWords")
3837
fun `parsing and printing a word written in this notation does not change the word`(word: String) {
3938
expect(word) {
40-
returnValueOf(subject::fromNotation, notation) {
41-
returnValueOf(subject::toNotation, notation).toBe(word)
39+
feature(String::fromNotation, notation) {
40+
feature(Word::toNotation, notation).toBe(word)
4241
}
4342
}
4443
}

src/test/kotlin/WordTest.kt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
package de.joshuagleitze.stringnotation
22

3-
import ch.tutteli.atrium.api.cc.en_GB.asIterable
4-
import ch.tutteli.atrium.api.cc.en_GB.containsExactly
5-
import ch.tutteli.atrium.api.cc.en_GB.property
6-
import ch.tutteli.atrium.verbs.expect
3+
import ch.tutteli.atrium.api.fluent.en_GB.asIterable
4+
import ch.tutteli.atrium.api.fluent.en_GB.containsExactly
5+
import ch.tutteli.atrium.api.fluent.en_GB.feature
6+
import ch.tutteli.atrium.api.verbs.expect
77
import org.junit.jupiter.api.Test
88

99
class WordTest {
1010
@Test
1111
fun `exposes parts as list`() {
12-
expect(Word("with", "parts")).property(Word::partsList).containsExactly("with", "parts")
13-
expect(Word(listOf("with", "parts"))).property(Word::partsList).containsExactly("with", "parts")
14-
expect(Word(sequenceOf("with", "parts"))).property(Word::partsList).containsExactly("with", "parts")
12+
expect(Word("with", "parts")).feature(Word::partsList).containsExactly("with", "parts")
13+
expect(Word(listOf("with", "parts"))).feature(Word::partsList).containsExactly("with", "parts")
14+
expect(Word(sequenceOf("with", "parts"))).feature(Word::partsList).containsExactly("with", "parts")
1515
}
1616

1717
@Test
1818
fun `exposes parts as sequence`() {
19-
expect(Word("with", "parts")).property(Word::parts).asIterable().containsExactly("with", "parts")
20-
expect(Word(listOf("with", "parts"))).property(Word::parts).asIterable().containsExactly("with", "parts")
21-
expect(Word(sequenceOf("with", "parts"))).property(Word::parts).asIterable().containsExactly("with", "parts")
19+
expect(Word("with", "parts")).feature(Word::parts).asIterable().containsExactly("with", "parts")
20+
expect(Word(listOf("with", "parts"))).feature(Word::parts).asIterable().containsExactly("with", "parts")
21+
expect(Word(sequenceOf("with", "parts"))).feature(Word::parts).asIterable().containsExactly("with", "parts")
2222
}
2323

2424
@Test
2525
fun `allows to add parts`() {
26-
expect((Word("with") + "more" + "parts")).property(Word::partsList).containsExactly("with", "more", "parts")
26+
expect((Word("with") + "more" + "parts")).feature(Word::partsList).containsExactly("with", "more", "parts")
2727
}
2828
}

0 commit comments

Comments
 (0)