Skip to content

Doesn't work with Robolectric unit tests #43

Description

@MuntashirAkon

You'd get the following error if you use Robolectric for unit testing. The current workaround is to catch IllegalStateException.

java.lang.IllegalStateException: Already initialized
at com.yariksoffice.lingver.Lingver$Companion.init(Lingver.kt:192)
at com.yariksoffice.lingver.Lingver$Companion.init(Lingver.kt:182)
at com.yariksoffice.lingver.Lingver.init(Lingver.kt)

This happens because Robolectric calls Application#onCreate() on each test.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions