MCPcopy Create free account
hub / github.com/cli/cli / TestNewCmdUpdate_ArgsPassedToOptions

Function TestNewCmdUpdate_ArgsPassedToOptions

pkg/cmd/skills/update/update_test.go:54–73  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func TestNewCmdUpdate_ArgsPassedToOptions(t *testing.T) {
55 ios, _, stdout, stderr := iostreams.Test()
56 f := &cmdutil.Factory{IOStreams: ios, Prompter: &prompter.PrompterMock{}, GitClient: &git.Client{}}
57
58 var gotOpts *UpdateOptions
59 cmd := NewCmdUpdate(f, func(opts *UpdateOptions) error {
60 gotOpts = opts
61 return nil
62 })
63
64 args, _ := shlex.Split("mcp-cli git-commit --all --force")
65 cmd.SetArgs(args)
66 cmd.SetOut(stdout)
67 cmd.SetErr(stderr)
68 err := cmd.Execute()
69 require.NoError(t, err)
70 assert.Equal(t, []string{"mcp-cli", "git-commit"}, gotOpts.Skills)
71 assert.True(t, gotOpts.All)
72 assert.True(t, gotOpts.Force)
73}
74
75func TestScanInstalledSkills(t *testing.T) {
76 tests := []struct {

Callers

nothing calls this directly

Calls 3

TestFunction · 0.92
NewCmdUpdateFunction · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected