summaryrefslogtreecommitdiff
path: root/test/handler/test_gitlint_handler.vader
diff options
context:
space:
mode:
authorNick Diego Yamane <nick.diego@gmail.com>2017-12-20 06:10:07 -0400
committerw0rp <w0rp@users.noreply.github.com>2017-12-20 10:10:07 +0000
commitd4b43d23f4a9f277a482fdad4ea3a3e951d80eab (patch)
tree0d66493a39ced077df4c978b0f1b1f3f30db80ba /test/handler/test_gitlint_handler.vader
parent1568bf81281507aaaa8c71af85e244e94bd2924c (diff)
downloadale-d4b43d23f4a9f277a482fdad4ea3a3e951d80eab.zip
Add support for linting git commit message files (#1233)
Diffstat (limited to 'test/handler/test_gitlint_handler.vader')
-rw-r--r--test/handler/test_gitlint_handler.vader37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/handler/test_gitlint_handler.vader b/test/handler/test_gitlint_handler.vader
new file mode 100644
index 00000000..58f5e67d
--- /dev/null
+++ b/test/handler/test_gitlint_handler.vader
@@ -0,0 +1,37 @@
+Before:
+ runtime ale_linters/gitcommit/gitlint.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(The gitlint handler should handle basic warnings and syntax errors):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'type': 'E',
+ \ 'text': 'B6: Body message is missing',
+ \ },
+ \ {
+ \ 'lnum': 2,
+ \ 'type': 'E',
+ \ 'text': 'B4: Second line is not empty: "to send to upstream"',
+ \ },
+ \ {
+ \ 'lnum': 3,
+ \ 'type': 'E',
+ \ 'text': 'B5: Body message is too short (19<20): "to send to upstream"',
+ \ },
+ \ {
+ \ 'lnum': 8,
+ \ 'type': 'E',
+ \ 'text': 'T1: Title exceeds max length (92>72): "some very long commit subject line where the author can''t wait to explain what he just fixed"'
+ \ },
+ \ ],
+ \ ale_linters#gitcommit#gitlint#Handle(1, [
+ \ '1: B6 Body message is missing',
+ \ '2: B4 Second line is not empty: "to send to upstream"',
+ \ '3: B5 Body message is too short (19<20): "to send to upstream"',
+ \ '8: T1 Title exceeds max length (92>72): "some very long commit subject line where the author can''t wait to explain what he just fixed"'
+ \ ])
+