You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/tests.bats
+17-12Lines changed: 17 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -118,26 +118,31 @@ load test_helper
118
118
}
119
119
}
120
120
121
+
test_help() {
122
+
assert_equal "${lines[1]}""Usage:"
123
+
assert_equal "${lines[2]}"" gh-md-toc [options] src [src] Create TOC for a README file (url or local path)"
124
+
assert_equal "${lines[3]}"" gh-md-toc - Create TOC for markdown from STDIN"
125
+
assert_equal "${lines[4]}"" gh-md-toc --help Show help"
126
+
assert_equal "${lines[5]}"" gh-md-toc --version Show version"
127
+
assert_equal "${lines[6]}""Options:"
128
+
assert_equal "${lines[7]}"" --indent <NUM> Set indent size. Default: 3."
129
+
assert_equal "${lines[8]}"" --insert Insert new TOC into original file. For local files only. Default: false."
130
+
assert_equal "${lines[10]}"" --no-backup Remove backup file. Set --insert as well. Defaul: false."
131
+
assert_equal "${lines[11]}"" --hide-footer Do not write date & author of the last TOC update. Set --insert as well. Default: false."
132
+
assert_equal "${lines[12]}"" --skip-header Hide entry of the topmost headlines. Default: false."
133
+
assert_equal "${#lines[@]}""14"
134
+
}
135
+
121
136
@test "--help" {
122
137
run $BATS_TEST_DIRNAME/../gh-md-toc --help
123
138
assert_success
124
-
assert_equal "${lines[1]}""Usage:"
125
-
assert_equal "${lines[2]}"" gh-md-toc [--insert] [--hide-footer] [--skip-header] [--indent #spaces] src [src] Create TOC for a README file (url or local path)"
assert_equal "${lines[4]}"" gh-md-toc - Create TOC for markdown from STDIN"
128
-
assert_equal "${lines[5]}"" gh-md-toc --help Show help"
129
-
assert_equal "${lines[6]}"" gh-md-toc --version Show version"
139
+
test_help
130
140
}
131
141
132
142
@test "no arguments" {
133
143
run $BATS_TEST_DIRNAME/../gh-md-toc
134
144
assert_success
135
-
assert_equal "${lines[1]}""Usage:"
136
-
assert_equal "${lines[2]}"" gh-md-toc [--insert] [--hide-footer] [--skip-header] [--indent #spaces] src [src] Create TOC for a README file (url or local path)"
0 commit comments