diff options
author | Helfull <admin@helfull.de> | 2023-10-28 19:22:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-28 19:22:37 +0200 |
commit | e316790f7132430c6d4e7621734999244fb2d34d (patch) | |
tree | 7f1bf7cdf528426f83332e571ddecaaf178a9554 | |
parent | 70ff0ca2e57f7e2ffba5891b7d3ec23255ccc7c7 (diff) | |
download | skyhanni-e316790f7132430c6d4e7621734999244fb2d34d.tar.gz skyhanni-e316790f7132430c6d4e7621734999244fb2d34d.tar.bz2 skyhanni-e316790f7132430c6d4e7621734999244fb2d34d.zip |
feat(Testing): add NEU as a test dependency (#599)
add NEU as a test dependency #599
-rw-r--r-- | build.gradle.kts | 4 | ||||
-rw-r--r-- | src/test/java/at/hannibal2/skyhanni/test/NEUDependencyTest.kt | 27 |
2 files changed, 31 insertions, 0 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index 992a12cd0..18195f085 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -93,6 +93,10 @@ dependencies { shadowImpl("org.jetbrains.kotlin:kotlin-reflect:1.9.0") // testImplementation(kotlin("test")) + testImplementation("com.github.NotEnoughUpdates:NotEnoughUpdates:v2.1.1-alpha22:all") { + exclude(module = "unspecified") + isTransitive = false + } testImplementation("org.junit.jupiter:junit-jupiter:5.10.0") testImplementation("io.mockk:mockk:1.12.5") } diff --git a/src/test/java/at/hannibal2/skyhanni/test/NEUDependencyTest.kt b/src/test/java/at/hannibal2/skyhanni/test/NEUDependencyTest.kt new file mode 100644 index 000000000..8ba7d1e82 --- /dev/null +++ b/src/test/java/at/hannibal2/skyhanni/test/NEUDependencyTest.kt @@ -0,0 +1,27 @@ +package at.hannibal2.skyhanni.test + +import at.hannibal2.skyhanni.test.NEUDependent.test +import io.github.moulberry.notenoughupdates.util.SkyBlockTime +import io.mockk.every +import io.mockk.mockkObject +import org.junit.jupiter.api.Test + +object NEUDependent { + fun mockMe(): Boolean { + return false + } + + fun SkyBlockTime.test(): Boolean { + return true + } +} + +class NEUDependencyTest { + @Test + fun `test that we can have extensions of NEU on object classes`() { + mockkObject(NEUDependent) + every { NEUDependent.mockMe() } returns true + assert(NEUDependent.mockMe()) + assert(SkyBlockTime(0).test()) + } +}
\ No newline at end of file |