ref: fix naming of test's supplementary files
authorAndrew Sichevoi <kondor@thekondor.net>
Tue, 15 May 2018 10:12:16 +0000 (13:12 +0300)
committerAndrew Sichevoi <kondor@thekondor.net>
Tue, 15 May 2018 10:12:16 +0000 (13:12 +0300)
src/git_purged/git_helpers_test.go [new file with mode: 0644]
src/git_purged/git_mock_test.go [new file with mode: 0644]
src/git_purged/git_test-helpers.go [deleted file]
src/git_purged/git_test-mock.go [deleted file]

diff --git a/src/git_purged/git_helpers_test.go b/src/git_purged/git_helpers_test.go
new file mode 100644 (file)
index 0000000..c3a2263
--- /dev/null
@@ -0,0 +1,33 @@
+// This file is a part of 'git-purged' tool, http://thekondor.net
+
+package git_purged
+
+import (
+    "github.com/stretchr/testify/mock"
+)
+
+func arrayOfStrings(args mock.Arguments, index int) []string {
+    arg := args.Get(0)
+    arrayOfString, ok := arg.([]string)
+    if !ok {
+        panic("Cannot cast to array of strings")
+    }
+
+    return arrayOfString
+}
+
+var EmptyStdOut = []string{}
+var EmptyError error = nil
+
+func withArgs(args ...string) []string {
+    return args
+}
+
+func stdOut(args ...string) []string {
+    return args
+}
+
+func anyArgument(interface{}) bool {
+    return true
+}
+
diff --git a/src/git_purged/git_mock_test.go b/src/git_purged/git_mock_test.go
new file mode 100644 (file)
index 0000000..e9426a2
--- /dev/null
@@ -0,0 +1,17 @@
+// This file is a part of 'git-purged' tool, http://thekondor.net
+
+package git_purged
+
+import (
+    "github.com/stretchr/testify/mock"
+)
+
+type GitExternalCommandMock struct {
+    mock.Mock
+}
+
+func (self *GitExternalCommandMock) Run(args ...string) ([]string, error) {
+    mockArgs := self.Called(args)
+    return arrayOfStrings(mockArgs, 0), mockArgs.Error(1)
+}
+
diff --git a/src/git_purged/git_test-helpers.go b/src/git_purged/git_test-helpers.go
deleted file mode 100644 (file)
index c3a2263..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-// This file is a part of 'git-purged' tool, http://thekondor.net
-
-package git_purged
-
-import (
-    "github.com/stretchr/testify/mock"
-)
-
-func arrayOfStrings(args mock.Arguments, index int) []string {
-    arg := args.Get(0)
-    arrayOfString, ok := arg.([]string)
-    if !ok {
-        panic("Cannot cast to array of strings")
-    }
-
-    return arrayOfString
-}
-
-var EmptyStdOut = []string{}
-var EmptyError error = nil
-
-func withArgs(args ...string) []string {
-    return args
-}
-
-func stdOut(args ...string) []string {
-    return args
-}
-
-func anyArgument(interface{}) bool {
-    return true
-}
-
diff --git a/src/git_purged/git_test-mock.go b/src/git_purged/git_test-mock.go
deleted file mode 100644 (file)
index e9426a2..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// This file is a part of 'git-purged' tool, http://thekondor.net
-
-package git_purged
-
-import (
-    "github.com/stretchr/testify/mock"
-)
-
-type GitExternalCommandMock struct {
-    mock.Mock
-}
-
-func (self *GitExternalCommandMock) Run(args ...string) ([]string, error) {
-    mockArgs := self.Called(args)
-    return arrayOfStrings(mockArgs, 0), mockArgs.Error(1)
-}
-