TDDing
This commit is contained in:
parent
a33afc99f6
commit
cefee4827b
|
@ -5,7 +5,7 @@ import org.junit.Test
|
|||
|
||||
class VersionCheckerUtilsKtTest {
|
||||
@Test
|
||||
fun findVersionMatches() {
|
||||
fun findVersionMatchesRegularVersion() {
|
||||
val buildGradle = """blabla
|
||||
| android {
|
||||
| aosenuthoae
|
||||
|
@ -16,4 +16,25 @@ class VersionCheckerUtilsKtTest {
|
|||
val detectedVersion: String? = buildGradle.byteInputStream().findVersion()
|
||||
assertEquals("2.2.2", detectedVersion)
|
||||
}
|
||||
|
||||
// 04. Break stuff.mp3 like it's 1999. Again. Pizza delivery! For i c wiener ...
|
||||
//@Test
|
||||
fun findVersionMatchesCustomVersion() {
|
||||
val buildGradle = """blabla
|
||||
| android {
|
||||
| aosenuthoae
|
||||
| }
|
||||
| version = "2.2.2-nefarious-underground-mod"
|
||||
| appName = "Aaoeu"
|
||||
""".trimMargin()
|
||||
val detectedVersion: String? = buildGradle.byteInputStream().findVersion()
|
||||
assertEquals("2.2.2", detectedVersion)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun findVersionMatchesDoesNotMatchErrorResponse() {
|
||||
val buildGradle = """<html><body>Balls! No build.gradle here. Move along</body><html>"""
|
||||
val detectedVersion: String? = buildGradle.byteInputStream().findVersion()
|
||||
assertEquals(null, detectedVersion)
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue