discord-kagebot/src/test/kotlin/moe/kageru/kagebot/features/ConfigFeatureTest.kt
kageru b0d3475469
Add getConfig feature to retrieve the current config file
This implements #11 and is preparation for config reloading at runtime
2019-07-14 17:14:23 +02:00

25 lines
731 B
Kotlin

package moe.kageru.kagebot.features
import io.kotlintest.shouldBe
import io.kotlintest.specs.ShouldSpec
import moe.kageru.kagebot.Kagebot
import moe.kageru.kagebot.TestUtil
import moe.kageru.kagebot.TestUtil.mockMessage
import moe.kageru.kagebot.TestUtil.withCommands
import java.io.File
class ConfigFeatureTest : ShouldSpec({
TestUtil.prepareTestEnvironment()
"getConfig should sent message with attachment" {
withCommands("""
[[command]]
trigger = "!getConfig"
feature = "getConfig"
""".trimIndent()) {
val calls = mutableListOf<File>()
Kagebot.processMessage(mockMessage("!getConfig", files = calls))
calls.size shouldBe 1
}
}
})