Skip to content

MockK 1.13.16 wraps Results objects twice #1333

@sschuberth

Description

@sschuberth

After upgrading from MockK 1.13.14 to 1.13.16, one of our tests starts to fail with

Result should be Success(fake_file), but was Success(Success(fake_file))
java.lang.AssertionError: Result should be Success(fake_file), but was Success(Success(fake_file))

The code for the test (using Kotest) looks like this:

    "return the generated file(s)" {
        val (_, reporterMock) = createReporterMock()
        val input = createReporterInput(SCANCODE_1)

        val reportFileResults = reporterMock.generateReport(input)

        reportFileResults.shouldBeSingleton {
            it shouldBeSuccess FILE_SAMPLE
        }
    }

So it's Kotest's shouldBeSuccess assertion that fails now.

Can this "double wrapping" in a Result type be a negative side-effect of #1332, @kpadhiamex?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions