From a6d7802a833af356c29fc4e739821064abfb56fd Mon Sep 17 00:00:00 2001 From: Gleb Koval Date: Wed, 10 Jan 2024 12:40:10 +0000 Subject: [PATCH] Fix README and test for throws on branch not found. --- README.md | 2 +- src/test/kotlin/tinyvm/RepositoryTest.kt | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fcdee1a..877c43f 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ dependencies { ### Documentation Use autocompletion and hover menus in your IDE, or download the -[generated HTML documentation](https://git.koval.net/cyclane/teamcity-gitea-test-task/releases/download/v0.1.1/tinyvm-0.1.1-javadoc.zip) +generated HTML documentation from the [latest release](https://git.koval.net/cyclane/teamcity-gitea-test-task/releases). ## Instructions diff --git a/src/test/kotlin/tinyvm/RepositoryTest.kt b/src/test/kotlin/tinyvm/RepositoryTest.kt index 4a7a7a0..965c48f 100644 --- a/src/test/kotlin/tinyvm/RepositoryTest.kt +++ b/src/test/kotlin/tinyvm/RepositoryTest.kt @@ -1,5 +1,6 @@ package tinyvm +import org.junit.jupiter.api.assertThrows import java.time.Instant import kotlin.test.Test import kotlin.test.assertEquals @@ -132,6 +133,13 @@ internal class RepositoryTest { assertEquals(10, repository.dumpObjects().size) } + @Test + fun `cannot use non-existent branch`() { + assertThrows { + repository.useBranch("test-branch") + } + } + @Test fun `can commit to branch`() { repository.commit(commits[0])