Skip to content

Commit 862273d

Browse files
authored
Update README.md
1 parent ad284c9 commit 862273d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ Kotlin Common Assertions
55
Kass is a multiplatform library, supporting JVM, Android, iOS (x64, ARM, Simulator-ARM), JS.
66

77
## Usage
8-
`assert()` and `assume()` both return objects that allow you to write expectations in a fluent style.
9-
`assert()` returns an `Assertion` object, while `assume()` returns an `Assumption` object.
8+
`assertThat(subject, statement)` and `assumeThat(subject, statement)` both evaluate the given subject against a given statement, which can be written in a fluent style using the provided statement functions.
9+
1010
When an assumption fails, the test execution will stop at that point, throwing a `FailedAssumption` error.
11-
To catch this error and fail silently, use the `runScenario(subject)` which takes a collection that
11+
To catch this error and fail silently, use `testScenario(subjects)` which takes a collection that
1212
provides subjects and a lambda executed on a Scenario object that wraps each subject.
13-
Use testHypothesis() to run a single test without an implicit subject.
13+
Use `testHypothesis()` to run a single test without an implicit subject.
1414

1515
When an assertion fails, tests fail normally.
1616

@@ -21,27 +21,27 @@ When an assertion fails, tests fail normally.
2121
fun some_hypothesis() = testHypothesis() {
2222
// Given a non-null subject
2323
val given = "a"
24-
assume().that(given).isNotNull()
24+
assumeThat(given, isNotNull())
2525

2626
// When some operation is performed
2727
val result = lengthOperation(given)
2828

2929
// Then the result is as expected
30-
assert().that(result).isEqualTo(1)
30+
assertThat(result, isEqualTo(1))
3131
}
3232

3333
private val subjectList = listOf(null, "a", "b", "c")
3434

3535
@Test
3636
fun some_scenario() = runScenario(subjectList) {
3737
// Given a non-null subject
38-
assume().that(subject).isNotNull()
38+
assumeThat(subject, isNotNull())
3939

4040
// When some operation is performed
4141
val result = someOperation(subject)
4242

4343
// Then the result is as expected
44-
assert().that(result).isEqualTo(expectedValue)
44+
assertThat(result, isEqualTo(expectedValue))
4545
}
4646

4747
```

0 commit comments

Comments
 (0)