summaryrefslogtreecommitdiff
path: root/test/handler/test_foodcritic_handler.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-11-21 13:38:27 +0000
committerw0rp <devw0rp@gmail.com>2017-11-21 13:38:33 +0000
commitac7f69063db30edfad14fac19b9d06be487885b1 (patch)
treea54c60e3c5bd05d10883d0e9a117e36a9f81801e /test/handler/test_foodcritic_handler.vader
parentce2986cfa502849e552b126e9df9d090275f98e2 (diff)
downloadale-ac7f69063db30edfad14fac19b9d06be487885b1.zip
#1151 - Overhaul the foodcritic linter for checking files on disk
Diffstat (limited to 'test/handler/test_foodcritic_handler.vader')
-rw-r--r--test/handler/test_foodcritic_handler.vader44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/handler/test_foodcritic_handler.vader b/test/handler/test_foodcritic_handler.vader
new file mode 100644
index 00000000..67cb6cab
--- /dev/null
+++ b/test/handler/test_foodcritic_handler.vader
@@ -0,0 +1,44 @@
+Before:
+ runtime ale_linters/chef/foodcritic.vim
+
+After:
+ call ale#linter#Reset()
+
+Execute(Basic warnings should be handled):
+ AssertEqual
+ \ [
+ \ {
+ \ 'lnum': 1,
+ \ 'code': 'CINK001',
+ \ 'type': 'W',
+ \ 'text': 'Missing CHANGELOG in markdown format',
+ \ 'filename': '/foo/bar/CHANGELOG.md',
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'code': 'FC011',
+ \ 'type': 'W',
+ \ 'text': 'Missing README in markdown format',
+ \ 'filename': '/foo/bar/README.md',
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'code': 'FC031',
+ \ 'type': 'W',
+ \ 'text': 'Cookbook without metadata.rb file',
+ \ 'filename': '/foo/bar/metadata.rb',
+ \ },
+ \ {
+ \ 'lnum': 1,
+ \ 'code': 'FC071',
+ \ 'type': 'W',
+ \ 'text': 'Missing LICENSE file',
+ \ 'filename': '/foo/bar/LICENSE',
+ \ },
+ \ ],
+ \ ale_linters#chef#foodcritic#Handle(bufnr(''), [
+ \ 'CINK001: Missing CHANGELOG in markdown format: /foo/bar/CHANGELOG.md:1',
+ \ 'FC011: Missing README in markdown format: /foo/bar/README.md:1',
+ \ 'FC031: Cookbook without metadata.rb file: /foo/bar/metadata.rb:1',
+ \ 'FC071: Missing LICENSE file: /foo/bar/LICENSE:1',
+ \ ])