From: David ‘Bombe’ Roden Date: Tue, 3 Dec 2019 17:53:24 +0000 (+0100) Subject: ✨ Allow specification of annotation for singleton verification X-Git-Tag: v81^2~5^2~83 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=0e736d6705877bec4c71dc90b07c20640aeae1bd;p=Sone.git ✨ Allow specification of annotation for singleton verification --- diff --git a/src/test/kotlin/net/pterodactylus/sone/test/Guice.kt b/src/test/kotlin/net/pterodactylus/sone/test/Guice.kt index a4ae1d5..b0bed5c 100644 --- a/src/test/kotlin/net/pterodactylus/sone/test/Guice.kt +++ b/src/test/kotlin/net/pterodactylus/sone/test/Guice.kt @@ -20,9 +20,9 @@ inline fun Injector.getInstance(annotation: Annotation? = null ?: getInstance(Key.get(object : TypeLiteral() {})) -inline fun Injector.verifySingletonInstance() { - val firstInstance = getInstance() - val secondInstance = getInstance() +inline fun Injector.verifySingletonInstance(annotation: Annotation? = null) { + val firstInstance = getInstance(annotation) + val secondInstance = getInstance(annotation) assertThat(firstInstance, sameInstance(secondInstance)) }