-
-
Notifications
You must be signed in to change notification settings - Fork 168
Expand file tree
/
Copy pathcoauthors_test.go
More file actions
46 lines (36 loc) · 1.27 KB
/
coauthors_test.go
File metadata and controls
46 lines (36 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package main
import (
"path/filepath"
"testing"
)
func TestStartDoneCoAuthors(t *testing.T) {
_, configuration := setup(t)
setWorkingDir(tempDir + "/alice")
start(configuration)
createFile(t, "file3.txt", "contentIrrelevant")
next(configuration)
setWorkingDir(tempDir + "/local")
start(configuration)
createFile(t, "file1.txt", "contentIrrelevant")
next(configuration)
setWorkingDir(tempDir + "/localother")
start(configuration)
createFile(t, "file2.txt", "contentIrrelevant")
next(configuration)
setWorkingDir(tempDir + "/alice")
start(configuration)
createFile(t, "file4.txt", "contentIrrelevant")
next(configuration)
setWorkingDir(tempDir + "/bob")
start(configuration)
createFile(t, "file5.txt", "contentIrrelevant")
next(configuration)
setWorkingDir(tempDir + "/local")
start(configuration)
done(configuration)
output := readFile(t, filepath.Join(tempDir, "local", ".git", "SQUASH_MSG"))
// don't include the person running `mob done`
assertOutputNotContains(t, &output, "Co-authored-by: local <local@example.com>")
// include everyone else in commit order after removing duplicates
assertOutputContains(t, &output, "\nCo-authored-by: bob <bob@example.com>\nCo-authored-by: alice <alice@example.com>\nCo-authored-by: localother <localother@example.com>\n")
}