Skip to content

Commit eea12c9

Browse files
CopilotReneWerner87
andcommitted
Update CLI version from 0.0.9 to 0.1.1 and add version display test
Co-authored-by: ReneWerner87 <[email protected]>
1 parent 43bc0d0 commit eea12c9

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
)
1212

1313
const (
14-
version = "0.0.9"
14+
version = "0.1.1"
1515
configName = ".fiberconfig"
1616
)
1717

cmd/root_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,14 @@ var fakeCliVersionResponse = func(version ...string) []byte {
134134
}
135135
return []byte(fmt.Sprintf(`{ "assets": [], "assets_url": "https://api.github.com/repos/gofiber/cli/releases/32630724/assets", "author": { "avatar_url": "https://avatars1.githubusercontent.com/u/1214670?v=4", "events_url": "https://api.github.com/users/kiyonlin/events{/privacy}", "followers_url": "https://api.github.com/users/kiyonlin/followers", "following_url": "https://api.github.com/users/kiyonlin/following{/other_user}", "gists_url": "https://api.github.com/users/kiyonlin/gists{/gist_id}", "gravatar_id": "", "html_url": "https://github.com/kiyonlin", "id": 1214670, "login": "kiyonlin", "node_id": "MDQ6VXNlcjEyMTQ2NzA=", "organizations_url": "https://api.github.com/users/kiyonlin/orgs", "received_events_url": "https://api.github.com/users/kiyonlin/received_events", "repos_url": "https://api.github.com/users/kiyonlin/repos", "site_admin": false, "starred_url": "https://api.github.com/users/kiyonlin/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/kiyonlin/subscriptions", "type": "User", "url": "https://api.github.com/users/kiyonlin" }, "created_at": "2020-10-15T15:58:55Z", "draft": false, "html_url": "https://github.com/gofiber/cli/releases/tag/v99.99.99", "id": 32630724, "name": "v%s", "node_id": "MDc6UmVsZWFzZTMyNjMwNzI0", "prerelease": false, "published_at": "2020-10-15T16:09:05Z", "tag_name": "v99.99.99", "tarball_url": "https://api.github.com/repos/gofiber/cli/tarball/v99.99.99", "target_commitish": "master", "upload_url": "https://uploads.github.com/repos/gofiber/cli/releases/32630724/assets{?name,label}", "url": "https://api.github.com/repos/gofiber/cli/releases/32630724", "zipball_url": "https://api.github.com/repos/gofiber/cli/zipball/v99.99.99"}`, v))
136136
}
137+
138+
func Test_Root_VersionDisplay(t *testing.T) {
139+
at, b := setupRootCmd(t)
140+
141+
err := rootRunE(rootCmd, nil)
142+
require.Error(t, err)
143+
144+
output := b.String()
145+
at.Contains(output, "CLI version 0.1.1")
146+
at.NotContains(output, "CLI version 0.0.9")
147+
}

0 commit comments

Comments
 (0)