MCPcopy
hub / github.com/cli/cli / TestIsPinnedGitExtensionPinned

Function TestIsPinnedGitExtensionPinned

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

Source from the content-addressed store, hash-verified

156}
157
158func TestIsPinnedGitExtensionPinned(t *testing.T) {
159 tempDir := t.TempDir()
160 extPath := filepath.Join(tempDir, "extensions", "gh-local", "gh-local")
161 assert.NoError(t, stubPinnedExtension(extPath, "abcd1234"))
162
163 gc := &mockGitClient{}
164 gc.On("CommandOutput", []string{"rev-parse", "HEAD"}).Return("abcd1234", nil)
165 e := &Extension{
166 kind: GitKind,
167 gitClient: gc,
168 path: extPath,
169 }
170
171 assert.True(t, e.IsPinned())
172 gc.AssertExpectations(t)
173}
174
175func TestIsPinnedLocalExtension(t *testing.T) {
176 tempDir := t.TempDir()

Callers

nothing calls this directly

Calls 3

IsPinnedMethod · 0.95
stubPinnedExtensionFunction · 0.85
JoinMethod · 0.80

Tested by

no test coverage detected