diff options
Diffstat (limited to 'internal/conf/mocks.go')
-rw-r--r-- | internal/conf/mocks.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/internal/conf/mocks.go b/internal/conf/mocks.go index 1f8e16f2..d4e57d38 100644 --- a/internal/conf/mocks.go +++ b/internal/conf/mocks.go @@ -8,6 +8,14 @@ import ( "testing" ) +func SetMockApp(t *testing.T, opts AppOpts) { + before := App + App = opts + t.Cleanup(func() { + App = before + }) +} + func SetMockServer(t *testing.T, opts ServerOpts) { before := Server Server = opts @@ -15,3 +23,27 @@ func SetMockServer(t *testing.T, opts ServerOpts) { Server = before }) } + +func SetMockSSH(t *testing.T, opts SSHOpts) { + before := SSH + SSH = opts + t.Cleanup(func() { + SSH = before + }) +} + +func SetMockRepository(t *testing.T, opts RepositoryOpts) { + before := Repository + Repository = opts + t.Cleanup(func() { + Repository = before + }) +} + +func SetMockUI(t *testing.T, opts UIOpts) { + before := UI + UI = opts + t.Cleanup(func() { + UI = before + }) +} |