(t *testing.T)
| 64 | } |
| 65 | |
| 66 | func TestGitHubRemoteSource(t *testing.T) { |
| 67 | mock := mockgit.NewMockGit(t) |
| 68 | mock.ExpectRemote("https://github.com/r2/d2.git") |
| 69 | |
| 70 | expect := config.Config{ |
| 71 | Repo: &config.RepoConfig{ |
| 72 | GitHubRepoOwner: "r2", |
| 73 | GitHubRepoName: "d2", |
| 74 | GitHubHost: "github.com", |
| 75 | RequireChecks: false, |
| 76 | RequireApproval: false, |
| 77 | MergeMethod: "", |
| 78 | }, |
| 79 | User: &config.UserConfig{ |
| 80 | ShowPRLink: false, |
| 81 | LogGitCommands: false, |
| 82 | LogGitHubCalls: false, |
| 83 | StatusBitsHeader: false, |
| 84 | }, |
| 85 | } |
| 86 | |
| 87 | actual := config.Config{ |
| 88 | Repo: &config.RepoConfig{}, |
| 89 | User: &config.UserConfig{}, |
| 90 | } |
| 91 | source := NewGitHubRemoteSource(&actual, mock) |
| 92 | source.Load(nil) |
| 93 | assert.Equal(t, expect, actual) |
| 94 | mock.ExpectationsMet() |
| 95 | } |
nothing calls this directly
no test coverage detected