Skip to content

Commit 6ab16c9

Browse files
committed
0.4.0
1 parent 984a62b commit 6ab16c9

File tree

2 files changed

+36
-9
lines changed

2 files changed

+36
-9
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,30 @@ You can easily combine both ways:
183183
Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)
184184
```
185185
186+
Tests
187+
=====
188+
189+
Done with [bats](https://github.com/sstephenson/bats).
190+
Useful articles:
191+
192+
* https://blog.engineyard.com/2014/bats-test-command-line-tools
193+
* http://blog.spike.cx/post/60548255435/testing-bash-scripts-with-bats
194+
195+
196+
How to run tests:
197+
198+
```bash
199+
➥ make test Пн. марта 23 13:59:27 MSK 2015
200+
✓ TOC for local README.md
201+
✓ TOC for remote README.md
202+
✓ TOC for mixed README.md (remote/local)
203+
✓ TOC for markdown from stdin
204+
✓ --help
205+
✓ --version
206+
207+
6 tests, 0 failures
208+
```
209+
186210
Dependency
187211
==========
188212

tests/tests.bats

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ load test_helper
1717
assert_equal "${lines[7]}" " * [Local files](#local-files)"
1818
assert_equal "${lines[8]}" " * [Remote files](#remote-files)"
1919
assert_equal "${lines[9]}" " * [Combo](#combo)"
20-
assert_equal "${lines[10]}" " * [Dependency](#dependency)"
21-
assert_equal "${lines[11]}" "Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)"
20+
assert_equal "${lines[10]}" " * [Tests](#tests)"
21+
assert_equal "${lines[11]}" " * [Dependency](#dependency)"
22+
assert_equal "${lines[12]}" "Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)"
2223

2324
}
2425

@@ -49,12 +50,13 @@ load test_helper
4950
assert_equal "${lines[5]}" " * [Local files](README.md#local-files)"
5051
assert_equal "${lines[6]}" " * [Remote files](README.md#remote-files)"
5152
assert_equal "${lines[7]}" " * [Combo](README.md#combo)"
52-
assert_equal "${lines[8]}" " * [Dependency](README.md#dependency)"
53-
assert_equal "${lines[9]}" " * [sitemap.js](https://github.com/ekalinin/sitemap.js/blob/master/README.md#sitemapjs)"
54-
assert_equal "${lines[10]}" " * [Installation](https://github.com/ekalinin/sitemap.js/blob/master/README.md#installation)"
55-
assert_equal "${lines[11]}" " * [Usage](https://github.com/ekalinin/sitemap.js/blob/master/README.md#usage)"
56-
assert_equal "${lines[12]}" " * [License](https://github.com/ekalinin/sitemap.js/blob/master/README.md#license)"
57-
assert_equal "${lines[13]}" "Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)"
53+
assert_equal "${lines[8]}" " * [Tests](README.md#tests)"
54+
assert_equal "${lines[9]}" " * [Dependency](README.md#dependency)"
55+
assert_equal "${lines[10]}" " * [sitemap.js](https://github.com/ekalinin/sitemap.js/blob/master/README.md#sitemapjs)"
56+
assert_equal "${lines[11]}" " * [Installation](https://github.com/ekalinin/sitemap.js/blob/master/README.md#installation)"
57+
assert_equal "${lines[12]}" " * [Usage](https://github.com/ekalinin/sitemap.js/blob/master/README.md#usage)"
58+
assert_equal "${lines[13]}" " * [License](https://github.com/ekalinin/sitemap.js/blob/master/README.md#license)"
59+
assert_equal "${lines[14]}" "Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)"
5860
}
5961

6062
@test "TOC for markdown from stdin" {
@@ -69,7 +71,8 @@ load test_helper
6971
assert_equal "${lines[5]}" " * [Local files](#local-files)"
7072
assert_equal "${lines[6]}" " * [Remote files](#remote-files)"
7173
assert_equal "${lines[7]}" " * [Combo](#combo)"
72-
assert_equal "${lines[8]}" " * [Dependency](#dependency)"
74+
assert_equal "${lines[8]}" " * [Tests](#tests)"
75+
assert_equal "${lines[9]}" " * [Dependency](#dependency)"
7376
}
7477
}
7578

0 commit comments

Comments
 (0)