MCPcopy Create free account
hub / github.com/remotemobprogramming/mob / TestStartDoneCoAuthors

Function TestStartDoneCoAuthors

coauthors_test.go:8–46  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

6)
7
8func TestStartDoneCoAuthors(t *testing.T) {
9 _, configuration := setup(t)
10
11 setWorkingDir(tempDir + "/alice")
12 start(configuration)
13 createFile(t, "file3.txt", "contentIrrelevant")
14 next(configuration)
15
16 setWorkingDir(tempDir + "/local")
17 start(configuration)
18 createFile(t, "file1.txt", "contentIrrelevant")
19 next(configuration)
20
21 setWorkingDir(tempDir + "/localother")
22 start(configuration)
23 createFile(t, "file2.txt", "contentIrrelevant")
24 next(configuration)
25
26 setWorkingDir(tempDir + "/alice")
27 start(configuration)
28 createFile(t, "file4.txt", "contentIrrelevant")
29 next(configuration)
30
31 setWorkingDir(tempDir + "/bob")
32 start(configuration)
33 createFile(t, "file5.txt", "contentIrrelevant")
34 next(configuration)
35
36 setWorkingDir(tempDir + "/local")
37 start(configuration)
38 done(configuration)
39
40 output := readFile(t, filepath.Join(tempDir, "local", ".git", "SQUASH_MSG"))
41
42 // don't include the person running `mob done`
43 assertOutputNotContains(t, &output, "Co-authored-by: local <local@example.com>")
44 // include everyone else in commit order after removing duplicates
45 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")
46}
47
48func TestCreateCommitMessage(t *testing.T) {
49 equals(t, `

Callers

nothing calls this directly

Calls 9

setupFunction · 0.85
setWorkingDirFunction · 0.85
startFunction · 0.85
createFileFunction · 0.85
nextFunction · 0.85
doneFunction · 0.85
readFileFunction · 0.85
assertOutputNotContainsFunction · 0.85
assertOutputContainsFunction · 0.85

Tested by

no test coverage detected