aboutsummaryrefslogtreecommitdiff
path: root/internal/conf/mocks.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/conf/mocks.go')
-rw-r--r--internal/conf/mocks.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/internal/conf/mocks.go b/internal/conf/mocks.go
new file mode 100644
index 00000000..1f8e16f2
--- /dev/null
+++ b/internal/conf/mocks.go
@@ -0,0 +1,17 @@
+// Copyright 2020 The Gogs Authors. All rights reserved.
+// Use of this source code is governed by a MIT-style
+// license that can be found in the LICENSE file.
+
+package conf
+
+import (
+ "testing"
+)
+
+func SetMockServer(t *testing.T, opts ServerOpts) {
+ before := Server
+ Server = opts
+ t.Cleanup(func() {
+ Server = before
+ })
+}