Auto-commit after successful build: update app gameplay/UI, improve build setup
Changed files:\napp/build.gradle.kts app/src/main/java/solutions/tretter/githugandroid/GitEditorCommands.kt app/src/main/java/solutions/tretter/githugandroid/GitHugApp.kt app/src/main/java/solutions/tretter/githugandroid/GitMessageEditorDialog.kt app/src/main/java/solutions/tretter/githugandroid/GitRuntime.kt app/src/test/java/solutions/tretter/githugandroid/GitEditorCommandsTest.kt
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
package solutions.tretter.githugandroid
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Test
|
||||
|
||||
class GitEditorCommandsTest {
|
||||
@Test
|
||||
fun commitWithoutMessageOpensEditor() {
|
||||
val invocation = parseGitEditorInvocation("git commit")
|
||||
|
||||
assertEquals(GitEditorCommandKind.COMMIT_MESSAGE, invocation?.kind)
|
||||
assertEquals("Edit Commit Message", invocation?.title)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun commitWithMessageDoesNotOpenEditor() {
|
||||
assertNull(parseGitEditorInvocation("git commit -m \"message\""))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun amendNoEditDoesNotOpenEditor() {
|
||||
assertNull(parseGitEditorInvocation("git commit --amend --no-edit"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun annotatedTagWithoutMessageOpensEditor() {
|
||||
val invocation = parseGitEditorInvocation("git tag -a v1.0")
|
||||
|
||||
assertEquals(GitEditorCommandKind.TAG_MESSAGE, invocation?.kind)
|
||||
assertEquals("Edit Tag Message", invocation?.title)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun lightweightTagDoesNotOpenEditor() {
|
||||
assertNull(parseGitEditorInvocation("git tag v1.0"))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user