diff options
author | Shogo NAMEKI <nametake.kyarabuki@gmail.com> | 2017-11-20 19:57:13 +0900 |
---|---|---|
committer | w0rp <w0rp@users.noreply.github.com> | 2017-11-20 10:57:13 +0000 |
commit | f20e5a4cf0e56c3c89ef7be4730924be377e5f61 (patch) | |
tree | 71abbae0f375fca62cf335f2cfc95b80aa2f31c3 /test/handler/test_drafter_handler.vader | |
parent | f224ce8a377bbb3a0deb78b98fdc6c43555791e2 (diff) | |
download | ale-f20e5a4cf0e56c3c89ef7be4730924be377e5f61.zip |
Add `drafter` for checking API Blueprint files (#1152)
Diffstat (limited to 'test/handler/test_drafter_handler.vader')
-rw-r--r-- | test/handler/test_drafter_handler.vader | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/handler/test_drafter_handler.vader b/test/handler/test_drafter_handler.vader new file mode 100644 index 00000000..1524dde1 --- /dev/null +++ b/test/handler/test_drafter_handler.vader @@ -0,0 +1,37 @@ +Before: + runtime! ale_linters/apiblueprint/drafter.vim + +After: + call ale#linter#Reset() + +Execute(drafter handler should handle errors output): + AssertEqual + \ [ + \ { + \ 'lnum': 25, + \ 'col': 3, + \ 'text': "unable to parse response signature, expected 'response [<HTTP status code>] [(<media type>)]'", + \ 'type': "W", + \ }, + \ { + \ 'lnum': 25, + \ 'col': 3, + \ 'text': "missing response HTTP status code, assuming 'Response 200'", + \ 'type': "W", + \ }, + \ { + \ 'lnum': 30, + \ 'col': 7, + \ 'end_lnum': 32, + \ 'end_col': 7, + \ 'text': "message-body asset is expected to be a pre-formatted code block, separate it by a newline and indent every of its line by 12 spaces or 3 tabs", + \ 'type': "W", + \ }, + \ ], + \ ale_linters#apiblueprint#drafter#HandleErrors(bufnr(''), [ + \ "", + \ "OK.", + \ "warning: (3) unable to parse response signature, expected 'response [<HTTP status code>] [(<media type>)]'; line 25, column 3 - line 25, column 29", + \ "warning: (6) missing response HTTP status code, assuming 'Response 200'; line 25, column 3 - line 25, column 29", + \ "warning: (10) message-body asset is expected to be a pre-formatted code block, separate it by a newline and indent every of its line by 12 spaces or 3 tabs; line 30, column 7 - line 30, column 11; line 31, column 6 - line 31, column 7; line 32, column 6 - line 32, column 7" + \ ]) |