MCPcopy Index your code
hub / github.com/jetify-com/devbox / TestGenerateGitPluginName

Function TestGenerateGitPluginName

internal/plugin/git_test.go:150–224  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

148}
149
150func TestGenerateGitPluginName(t *testing.T) {
151 testCases := []struct {
152 name string
153 ref flake.Ref
154 expected string
155 }{
156 {
157 name: "github repository",
158 ref: flake.Ref{
159 URL: "https://github.com/jetify-com/devbox-plugins.git",
160 },
161 expected: "jetify-com.devbox-plugins",
162 },
163 {
164 name: "gitlab repository with subgroups",
165 ref: flake.Ref{
166 URL: "https://gitlab.com/group/subgroup/repo.git",
167 },
168 expected: "subgroup.repo",
169 },
170 {
171 name: "repository without .git suffix",
172 ref: flake.Ref{
173 URL: "https://github.com/jetify-com/devbox-plugins",
174 },
175 expected: "jetify-com.devbox-plugins",
176 },
177 {
178 name: "repository with single path component",
179 ref: flake.Ref{
180 URL: "https://github.com/repo",
181 },
182 expected: "github.com.repo",
183 },
184 {
185 name: "SSH repository",
186 ref: flake.Ref{
187 URL: "ssh://git@github.com/jetify-com/devbox-plugins.git",
188 },
189 expected: "jetify-com.devbox-plugins",
190 },
191 {
192 name: "file repository",
193 ref: flake.Ref{
194 URL: "file:///tmp/local-repo.git",
195 },
196 expected: "tmp.local-repo",
197 },
198 {
199 name: "repository with directory",
200 ref: flake.Ref{
201 URL: "https://github.com/jetify-com/devbox-plugins.git",
202 Dir: "mongodb",
203 },
204 expected: "jetify-com.devbox-plugins.mongodb",
205 },
206 {
207 name: "repository with nested directory",

Callers

nothing calls this directly

Calls 2

generateGitPluginNameFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected