diff --git a/tests/testthat/_snaps/bump_version.md b/tests/testthat/_snaps/bump_version.md index 890f9f9c..c00d5bca 100644 --- a/tests/testthat/_snaps/bump_version.md +++ b/tests/testthat/_snaps/bump_version.md @@ -91,7 +91,7 @@ Code bump_version(no_change_behavior = "fail") Message - > Digesting messages from 2 commits. + > Digesting messages from 1 commits. Condition Error in `bump_version_impl()`: x No change since last version. @@ -102,7 +102,7 @@ Code bump_version(no_change_behavior = "noop") Message - > Digesting messages from 2 commits. + > Digesting messages from 1 commits. i No change since last version. --- @@ -110,8 +110,8 @@ Code bump_version(no_change_behavior = "bump") Message - > Digesting messages from 2 commits. - i Internal changes only. + > Digesting messages from 1 commits. + i Same as previous version. -- Updating NEWS -- diff --git a/tests/testthat/_snaps/bump_version/NEWS3.md b/tests/testthat/_snaps/bump_version/NEWS3.md index 8880a043..1dc9b063 100644 --- a/tests/testthat/_snaps/bump_version/NEWS3.md +++ b/tests/testthat/_snaps/bump_version/NEWS3.md @@ -2,7 +2,7 @@ # tea 0.0.0.9002 -- Internal changes only. +- Same as previous version. # tea 0.0.0.9001 diff --git a/tests/testthat/test-bump_version.R b/tests/testthat/test-bump_version.R index 1c1c09b6..3ea27d77 100644 --- a/tests/testthat/test-bump_version.R +++ b/tests/testthat/test-bump_version.R @@ -10,7 +10,9 @@ test_that("bump_version() works -- dev", { expect_equal(as.character(desc::desc_get_version()), "0.0.0.9000") - expect_snapshot(bump_version()) + expect_snapshot({ + bump_version() + }) expect_equal(as.character(desc::desc_get_version()), "0.0.0.9001") expect_equal(get_last_version_tag()[["name"]], "v0.0.0.9001") @@ -38,6 +40,9 @@ test_that("bump_version() works -- dev", { test_that("bump_version() works -- dev squash", { local_demo_project(quiet = TRUE) + # Important for the squash to actually create a different commit + gert::git_config_set("merge.ff", "false") + tempdir_remote <- withr::local_tempdir(pattern = "remote") create_remote(tempdir_remote) @@ -49,7 +54,9 @@ test_that("bump_version() works -- dev squash", { gert::git_branch_create("fledge") - expect_snapshot(bump_version(check_default_branch = FALSE)) + expect_snapshot({ + bump_version(check_default_branch = FALSE) + }) gert::git_branch_checkout("main") gert::git_merge("fledge", squash = TRUE)