-
-
Notifications
You must be signed in to change notification settings - Fork 150
/
status_test.go
52 lines (39 loc) · 1.27 KB
/
status_test.go
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
47
48
49
50
51
52
package main
import (
config "github.com/remotemobprogramming/mob/v5/configuration"
"strconv"
"testing"
)
func TestExecuteKicksOffStatus(t *testing.T) {
output, _ := setup(t)
execute("status", []string{}, config.GetDefaultConfiguration())
assertOutputContains(t, output, "you are on base branch 'master'")
}
func TestStatusMobProgramming(t *testing.T) {
output, configuration := setup(t)
start(configuration)
status(configuration)
assertOutputContains(t, output, "you are on wip branch mob-session")
}
func TestStatusWithMoreThan5LinesOfLog(t *testing.T) {
output, configuration := setup(t)
configuration.NextStay = true
start(configuration)
for i := 0; i < 6; i++ {
createFile(t, "test"+strconv.Itoa(i)+".txt", "contentIrrelevant")
next(configuration)
}
status(configuration)
assertOutputContains(t, output, "wip branch 'mob-session' contains 6 commits.")
}
func TestStatusDetectsWipBranches(t *testing.T) {
output, configuration := setup(t)
start(configuration)
createFile(t, "test.txt", "contentIrrelevant")
next(configuration)
git("checkout", "master")
status(configuration)
assertOutputContains(t, output, "remote wip branches detected:\n - origin/mob-session")
assertOutputContains(t, output, " second")
assertOutputContains(t, output, " ago)")
}