Skip to content

Commit

Permalink
added tests for help/version
Browse files Browse the repository at this point in the history
  • Loading branch information
ekalinin committed Mar 23, 2015
1 parent cb17ae6 commit 984a62b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/tests.bats
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,20 @@ load test_helper
assert_equal "${lines[8]}" " * [Dependency](#dependency)"
}
}

@test "--help" {
run $BATS_TEST_DIRNAME/../gh-md-toc --help
assert_success
assert_equal "${lines[0]}" "GitHub TOC generator (gh-md-toc): 0.4.0"
assert_equal "${lines[1]}" "Usage:"
assert_equal "${lines[2]}" " gh-md-toc src [src] Create TOC for a README file (url or local path)"
assert_equal "${lines[3]}" " gh-md-toc - Create TOC for markdown from STDIN"
assert_equal "${lines[4]}" " gh-md-toc --help Show help"
assert_equal "${lines[5]}" " gh-md-toc --version Show help"
}

@test "--version" {
run $BATS_TEST_DIRNAME/../gh-md-toc --version
assert_success
assert_equal "${lines[0]}" "0.4.0"
}

0 comments on commit 984a62b

Please sign in to comment.