(t *testing.T)
| 13 | ) |
| 14 | |
| 15 | func TestGitPlugin(t *testing.T) { |
| 16 | testCases := []struct { |
| 17 | name string |
| 18 | ref string |
| 19 | expected *gitPlugin |
| 20 | }{ |
| 21 | { |
| 22 | name: "basic git plugin", |
| 23 | ref: "git+https://github.com/jetify-com/devbox-plugins.git", |
| 24 | expected: &gitPlugin{ |
| 25 | ref: &flake.Ref{ |
| 26 | Type: flake.TypeGit, |
| 27 | URL: "https://github.com/jetify-com/devbox-plugins.git", |
| 28 | }, |
| 29 | name: "jetify-com.devbox-plugins", |
| 30 | }, |
| 31 | }, |
| 32 | { |
| 33 | name: "git plugin with ref", |
| 34 | ref: "git+https://github.com/jetify-com/devbox-plugins.git?ref=main", |
| 35 | expected: &gitPlugin{ |
| 36 | ref: &flake.Ref{ |
| 37 | Type: flake.TypeGit, |
| 38 | URL: "https://github.com/jetify-com/devbox-plugins.git", |
| 39 | Ref: "main", |
| 40 | }, |
| 41 | name: "jetify-com.devbox-plugins", |
| 42 | }, |
| 43 | }, |
| 44 | { |
| 45 | name: "git plugin with rev", |
| 46 | ref: "git+https://github.com/jetify-com/devbox-plugins.git?rev=abc123", |
| 47 | expected: &gitPlugin{ |
| 48 | ref: &flake.Ref{ |
| 49 | Type: flake.TypeGit, |
| 50 | URL: "https://github.com/jetify-com/devbox-plugins.git", |
| 51 | Rev: "abc123", |
| 52 | }, |
| 53 | name: "jetify-com.devbox-plugins", |
| 54 | }, |
| 55 | }, |
| 56 | { |
| 57 | name: "git plugin with directory", |
| 58 | ref: "git+https://github.com/jetify-com/devbox-plugins.git?dir=mongodb", |
| 59 | expected: &gitPlugin{ |
| 60 | ref: &flake.Ref{ |
| 61 | Type: flake.TypeGit, |
| 62 | URL: "https://github.com/jetify-com/devbox-plugins.git?dir=mongodb", |
| 63 | Dir: "mongodb", |
| 64 | }, |
| 65 | name: "jetify-com.devbox-plugins.mongodb", |
| 66 | }, |
| 67 | }, |
| 68 | { |
| 69 | name: "git plugin with directory and ref", |
| 70 | ref: "git+https://github.com/jetify-com/devbox-plugins.git?dir=mongodb&ref=my-branch", |
| 71 | expected: &gitPlugin{ |
| 72 | ref: &flake.Ref{ |
nothing calls this directly
no test coverage detected