MCPcopy
hub / github.com/cli/cli / TestIsPinnedGitExtensionUnpinned

Function TestIsPinnedGitExtensionUnpinned

pkg/cmd/extension/extension_test.go:141–156  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

139}
140
141func TestIsPinnedGitExtensionUnpinned(t *testing.T) {
142 tempDir := t.TempDir()
143 extPath := filepath.Join(tempDir, "extensions", "gh-local", "gh-local")
144 assert.NoError(t, stubExtension(extPath))
145
146 gc := &mockGitClient{}
147 gc.On("CommandOutput", []string{"rev-parse", "HEAD"}).Return("abcd1234", nil)
148 e := &Extension{
149 kind: GitKind,
150 gitClient: gc,
151 path: extPath,
152 }
153
154 assert.False(t, e.IsPinned())
155 gc.AssertExpectations(t)
156}
157
158func TestIsPinnedGitExtensionPinned(t *testing.T) {
159 tempDir := t.TempDir()

Callers

nothing calls this directly

Calls 3

IsPinnedMethod · 0.95
stubExtensionFunction · 0.85
JoinMethod · 0.80

Tested by

no test coverage detected