summaryrefslogtreecommitdiff
path: root/test/handler
diff options
context:
space:
mode:
authorDmitri Vereshchagin <dmitri.vereshchagin@gmail.com>2019-09-01 17:36:40 +0300
committerDmitri Vereshchagin <dmitri.vereshchagin@gmail.com>2020-09-06 12:40:28 +0300
commit49718e0ec6eb4b9068049048c9373167c19257c9 (patch)
tree3df86c81d31ccedd77dddd68b1fcdb551bb55958 /test/handler
parent5bc49d204782617e01da65d83c0d9700a1b0a72f (diff)
downloadale-49718e0ec6eb4b9068049048c9373167c19257c9.zip
Add Elvis handler for Erlang
[Elvis][1] is an Erlang style reviewer. [1]: https://github.com/inaka/elvis
Diffstat (limited to 'test/handler')
-rw-r--r--test/handler/test_erlang_elvis_handler.vader37
1 files changed, 37 insertions, 0 deletions
diff --git a/test/handler/test_erlang_elvis_handler.vader b/test/handler/test_erlang_elvis_handler.vader
new file mode 100644
index 00000000..365376c8
--- /dev/null
+++ b/test/handler/test_erlang_elvis_handler.vader
@@ -0,0 +1,37 @@
+Before:
+ runtime ale_linters/erlang/elvis.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(Warning messages should be handled):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 11,
+ \ 'text': "Replace the 'if' expression on line 11 with a 'case' expression or function clauses.",
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'lnum': 20,
+ \ 'text': 'Remove the debug call to io:format/1 on line 20.',
+ \ 'type': 'W',
+ \ },
+ \ ],
+ \ ale_linters#erlang#elvis#Handle(bufnr(''), [
+ \ "src/foo.erl:11:no_if_expression:Replace the 'if' expression on line 11 with a 'case' expression or function clauses.",
+ \ 'src/foo.erl:20:no_debug_call:Remove the debug call to io:format/1 on line 20.',
+ \ ])
+
+Execute(Line length message shouldn't contain the line itself):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 24,
+ \ 'text': 'Line 24 is too long.',
+ \ 'type': 'W',
+ \ },
+ \ ],
+ \ ale_linters#erlang#elvis#Handle(bufnr(''), [
+ \ 'src/foo.erl:24:line_length:Line 24 is too long: io:format("Look ma, too long!"),.',
+ \ ])