From e5f8667dfc3b78418015af8dbce6ab936ba37f4b Mon Sep 17 00:00:00 2001 From: Phil Jay Date: Mon, 18 Sep 2023 08:46:35 +1000 Subject: [PATCH] Add test for `release_branch` --- tests/test_version-increment.bats | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_version-increment.bats b/tests/test_version-increment.bats index e6c1481..f2da4d7 100644 --- a/tests/test_version-increment.bats +++ b/tests/test_version-increment.bats @@ -224,6 +224,22 @@ function init_repo { [[ "$output" = *"VERSION=1.2.4-pre.${short_ref}"* ]] } +@test "does not append prerelease information if on a specified release_branch" { + init_repo + + export current_version=1.2.3 + export GITHUB_REF="refs/heads/releases" + export release_branch="releases" + + run ../../version-increment.sh + + print_run_info + [ "$status" -eq 0 ] && + [[ "$output" != *"PRE_RELEASE_LABEL=pre."* ]] && + [[ "$output" != *"VERSION=1.2.4-pre."* ]] && + [[ "$output" = *"VERSION=1.2.4"* ]] +} + @test "appends prerelease information in pep440 compatible way when pep440 is true" { init_repo