diff --git a/pkg/cmd/repo/rename/rename_test.go b/pkg/cmd/repo/rename/rename_test.go new file mode 100644 index 000000000..c91a7a427 --- /dev/null +++ b/pkg/cmd/repo/rename/rename_test.go @@ -0,0 +1,40 @@ +package rename + +import ( + "testing" +) + +func TestNewCmdRename(t * testing.T) { + tests := []struct { + name string + tty bool + input string + output RenameOptions + wantErr bool + errMsg string + }{ + { + name: "no argument", + tty: true, + input: "", + output: RenameOptions{}, + }, + { + name: "argument", + tty: true, + input: "cli/cli", + output: RenameOptions{ + DestArg: "cli comand-line-interface", + }, + }, + { + name: "incorrect argument", + tty: true, + input: "", + output: RenameOptions{ + DestArg: "cli ", + }, + }, + } +} + diff --git a/pkg/cmd/repo/repo.go b/pkg/cmd/repo/repo.go index 608d0a2ff..973bc33df 100644 --- a/pkg/cmd/repo/repo.go +++ b/pkg/cmd/repo/repo.go @@ -8,9 +8,9 @@ import ( repoForkCmd "github.com/cli/cli/v2/pkg/cmd/repo/fork" gardenCmd "github.com/cli/cli/v2/pkg/cmd/repo/garden" repoListCmd "github.com/cli/cli/v2/pkg/cmd/repo/list" + repoRenameCmd "github.com/cli/cli/v2/pkg/cmd/repo/rename" repoSyncCmd "github.com/cli/cli/v2/pkg/cmd/repo/sync" repoViewCmd "github.com/cli/cli/v2/pkg/cmd/repo/view" - repoRenameCmd "github.com/cli/cli/v2/pkg/cmd/repo/rename" "github.com/cli/cli/v2/pkg/cmdutil" "github.com/spf13/cobra" )