Skip to content

Commit

Permalink
✅ adds tests for mix bump next
Browse files Browse the repository at this point in the history
  • Loading branch information
mpanarin committed Mar 13, 2024
1 parent 2ff1760 commit b95de72
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/bumper_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ defmodule VersioceTest.Bumper do
use Mimic

defp helper_bump(options, version) do
options
options = options
|> Bump.parse()
|> Bumper.bump(version)

new_version = Bumper.get_new_version(options, version)

Bumper.bump(version, new_version)
end

defp test_versioning(binding, new_vers) do
Expand Down Expand Up @@ -79,6 +82,13 @@ defmodule VersioceTest.Bumper do
test_build_pre("minor", "0.2.0")
end

test "Bump with next" do
assert helper_bump(["next"], "0.1.0-alpha") == "0.1.0"
assert helper_bump(["next", "--pre", "beta"], "0.1.0-alpha") == "0.1.0-beta"
assert helper_bump(["next", "--pre", "beta"], "0.1.0") == "0.1.0-beta"
test_build_pre("next", "0.1.0")
end

test "Bump with major" do
test_versioning("major", "1.0.0")
test_build_pre("major", "1.0.0")
Expand Down

0 comments on commit b95de72

Please sign in to comment.