-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathglch_test.go
52 lines (34 loc) · 899 Bytes
/
glch_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 (
"bytes"
"fmt"
"testing"
"time"
)
func Test_run(t *testing.T) {
outStream, errStream := new(bytes.Buffer), new(bytes.Buffer)
glch := glch{
repository: testGitlabClient(t),
projectPath: "shiimaxx/glch-demo",
outStream: outStream,
errStream: errStream,
}
args := []string{"glch"}
exitCode := glch.run(args)
if exitCode != 0 {
t.Fatal(errStream.String())
}
today := time.Now().Format("2006-01-02")
want := fmt.Sprintf(`## Unreleased - %s
- Feature 3 shiimaxx/glch-demo!3 from [@shiimaxx](https://gitlab.com/shiimaxx)
## v0.2.0 - 2020-05-09
- Feature 2 shiimaxx/glch-demo!2 from [@shiimaxx](https://gitlab.com/shiimaxx)
- Feature 1 shiimaxx/glch-demo!1 from [@shiimaxx](https://gitlab.com/shiimaxx)
## v0.1.0 - 2020-05-09
- Initial release
`, today)
got := outStream.String()
if got != want {
t.Fatalf("got %s, want %s", got, want)
}
}