forked from cli/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_test.go
More file actions
32 lines (28 loc) · 739 Bytes
/
main_test.go
File metadata and controls
32 lines (28 loc) · 739 Bytes
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
package main
import (
"io/ioutil"
"strings"
"testing"
)
func Test_run(t *testing.T) {
dir := t.TempDir()
args := []string{"--man-page", "--website", "--doc-path", dir}
err := run(args)
if err != nil {
t.Fatalf("got error: %v", err)
}
manPage, err := ioutil.ReadFile(dir + "/gh-issue-create.1")
if err != nil {
t.Fatalf("error reading `gh-issue-create.1`: %v", err)
}
if !strings.Contains(string(manPage), `\fBgh issue create`) {
t.Fatal("man page corrupted")
}
markdownPage, err := ioutil.ReadFile(dir + "/gh_issue_create.md")
if err != nil {
t.Fatalf("error reading `gh_issue_create.md`: %v", err)
}
if !strings.Contains(string(markdownPage), `## gh issue create`) {
t.Fatal("markdown page corrupted")
}
}