Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
feat(commands/variable): add variable set command
Browse files Browse the repository at this point in the history
Adds `variable set` command for creating GitLab environment variables.

Variable can be created for a project or a group specified with `--group | -g` flag.

Resolves #515
  • Loading branch information
profclems committed Jan 10, 2021
1 parent 7e077d4 commit 5f28a1f
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions commands/variable/set/set_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package set

import "testing"

func Test_isValidKey(t *testing.T) {
type args struct {
key string
}
tests := []struct {
name string
args args
want bool
}{
{
name: "key is empty",
args: args{
key: "",
},
want: false,
},
{
name: "key is valid",
args: args{
key: "abc123_",
},
want: true,
},
{
name: "key is invalid",
args: args{
key: "abc-123",
},
want: true,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := isValidKey(tt.args.key); got != tt.want {
t.Errorf("isValidKey() = %v, want %v", got, tt.want)
}
})
}
}

0 comments on commit 5f28a1f

Please sign in to comment.