]> git.madduck.net Git - etc/vim.git/blobdiff - .vim/bundle/ale/test/handler/test_yamllint_handler.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '76265755a1add77121c8f9dabb3e9bb70fe9a972' as '.vim/bundle/ale'
[etc/vim.git] / .vim / bundle / ale / test / handler / test_yamllint_handler.vader
diff --git a/.vim/bundle/ale/test/handler/test_yamllint_handler.vader b/.vim/bundle/ale/test/handler/test_yamllint_handler.vader
new file mode 100644 (file)
index 0000000..dd51119
--- /dev/null
@@ -0,0 +1,59 @@
+Before:
+  Save g:ale_warn_about_trailing_whitespace
+
+  let g:ale_warn_about_trailing_whitespace = 1
+
+  runtime! ale/handlers/yamllint.vim
+
+After:
+  Restore
+
+  unlet! b:ale_warn_about_trailing_whitespace
+
+  call ale#linter#Reset()
+
+Execute(Problems should be parsed correctly for yamllint):
+  AssertEqual
+  \ [
+  \   {
+  \     'lnum': 1,
+  \     'col': 1,
+  \     'type': 'W',
+  \     'text': 'missing document start "---"',
+  \     'code': 'document-start',
+  \   },
+  \   {
+  \     'lnum': 2,
+  \     'col': 1,
+  \     'type': 'E',
+  \     'text': 'syntax error: expected the node content, but found ''<stream end>''',
+  \   },
+  \ ],
+  \ ale#handlers#yamllint#Handle(bufnr(''), [
+  \   'something.yaml:1:1: [warning] missing document start "---" (document-start)',
+  \   'something.yml:2:1: [error] syntax error: expected the node content, but found ''<stream end>''',
+  \ ])
+
+Execute(The yamllint handler should respect ale_warn_about_trailing_whitespace):
+  AssertEqual
+  \ [
+  \   {
+  \     'lnum': 5,
+  \     'col': 18,
+  \     'type': 'E',
+  \     'text': 'trailing spaces',
+  \     'code': 'trailing-spaces',
+  \   },
+  \ ],
+  \ ale#handlers#yamllint#Handle(bufnr(''), [
+  \   'something.yml:5:18: [error] trailing spaces (trailing-spaces)',
+  \ ])
+
+  let b:ale_warn_about_trailing_whitespace = 0
+
+  AssertEqual
+  \ [
+  \ ],
+  \ ale#handlers#yamllint#Handle(bufnr(''), [
+  \   'something.yml:5:18: [error] trailing spaces (trailing-spaces)',
+  \ ])