Skip to content

Commit

Permalink
Merge pull request #1 from cedro-people/bugfix/patch-number-reset
Browse files Browse the repository at this point in the history
bugfix/patch number reset
  • Loading branch information
maykonlsf authored Dec 5, 2019
2 parents 1cb8d61 + aabae5e commit 7e38ba8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions internal/controllers/increase.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func IncreaseVersionAlpha(version *entities.Version) *entities.Version {

version.Minor++
version.Phase = phases.Alpha
version.Patch = 0
version.PatchNumber = 1

return version
Expand Down
6 changes: 3 additions & 3 deletions internal/controllers/increase_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
func TestIncreaseVersionAlpha(t *testing.T) {
Convey("Given an previous version and increase to next alpha", t, func() {
Convey("When previous version is already and alpha", func() {
version, _ := entities.NewVersion("1.0.0-alpha.1")
version, _ := entities.NewVersion("1.0.1-alpha.1")
Convey("Then should increase patch count version", func() {
newVersion := IncreaseVersionAlpha(version)
So(newVersion.String(), ShouldEqual, "v1.0.0-alpha.2")
So(newVersion.String(), ShouldEqual, "v1.0.1-alpha.2")
})
})

Expand Down Expand Up @@ -57,7 +57,7 @@ func TestIncreaseVersionAlpha(t *testing.T) {
})

Convey("When previous version is an release", func() {
version, _ := entities.NewVersion("1.0.0")
version, _ := entities.NewVersion("1.0.1")
Convey("Then should increase patch count version", func() {
newVersion := IncreaseVersionAlpha(version)
So(newVersion.String(), ShouldEqual, "v1.1.0-alpha.1")
Expand Down

0 comments on commit 7e38ba8

Please sign in to comment.