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