File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
src/main/kotlin/in/rcard/assertj/arrowcore Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ abstract class AbstractOptionAssert<
4343 */
4444 fun isEmpty (): SELF {
4545 isNotNull
46- if (actual.isDefined ()) throwAssertionError(shouldBeEmpty(actual))
46+ if (actual.isSome ()) throwAssertionError(shouldBeEmpty(actual))
4747 return myself
4848 }
4949
@@ -74,7 +74,7 @@ abstract class AbstractOptionAssert<
7474 */
7575 fun containsInstanceOf (expectedClass : Class <* >): SELF {
7676 assertValueIsPresent()
77- actual.tap { value ->
77+ actual.onSome { value ->
7878 if (! expectedClass.isInstance(value)) {
7979 throwAssertionError(
8080 shouldContainInstanceOf(
@@ -104,6 +104,6 @@ abstract class AbstractOptionAssert<
104104
105105 private fun assertValueIsPresent () {
106106 isNotNull
107- if (actual.isEmpty ()) throwAssertionError(shouldBePresent())
107+ if (actual.isNone ()) throwAssertionError(shouldBePresent())
108108 }
109109}
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import org.assertj.core.error.BasicErrorMessageFactory
1010 * @since 0.0.1
1111 */
1212internal class OptionShouldBeEmpty private constructor(expected : Option <* >) :
13- BasicErrorMessageFactory (" %nExpecting an Option to be empty but was <%s>." , expected.orNull ()) {
13+ BasicErrorMessageFactory (" %nExpecting an Option to be empty but was <%s>." , expected.getOrNull ()) {
1414 companion object {
1515 internal fun shouldBeEmpty (actual : Option <* >): OptionShouldBeEmpty =
1616 OptionShouldBeEmpty (actual)
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import org.assertj.core.error.BasicErrorMessageFactory
1010 * @since 0.0.1
1111 */
1212internal class OptionShouldBePresent private constructor() :
13- BasicErrorMessageFactory (" %nExpecting Option to contain a value but it didn't." .format() ) {
13+ BasicErrorMessageFactory (" %nExpecting Option to contain a value but it didn't." ) {
1414 companion object {
1515
1616 /* *
You can’t perform that action at this time.
0 commit comments