(t *testing.T, opts RepositoryOpts)
| 48 | var mockRepository sync.Mutex |
| 49 | |
| 50 | func SetMockRepository(t *testing.T, opts RepositoryOpts) { |
| 51 | mockRepository.Lock() |
| 52 | before := Repository |
| 53 | Repository = opts |
| 54 | t.Cleanup(func() { |
| 55 | Repository = before |
| 56 | mockRepository.Unlock() |
| 57 | }) |
| 58 | } |
| 59 | |
| 60 | func SetMockUI(t *testing.T, opts UIOpts) { |
| 61 | before := UI |
no outgoing calls