summaryrefslogtreecommitdiff
path: root/test/handler/test_rubocop_handler.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-03-27 19:53:12 +0100
committerw0rp <devw0rp@gmail.com>2017-03-27 19:53:12 +0100
commit4abefc189c04c70972a398254675f7ec93a8eba0 (patch)
treeaede7f183abb5427be3c52929c5ed62bea507896 /test/handler/test_rubocop_handler.vader
parentb9c078da2030c0bc756a6caa7c87703b7b46ac11 (diff)
downloadale-4abefc189c04c70972a398254675f7ec93a8eba0.zip
Cover the rubocop handler with tests
Diffstat (limited to 'test/handler/test_rubocop_handler.vader')
-rw-r--r--test/handler/test_rubocop_handler.vader44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/handler/test_rubocop_handler.vader b/test/handler/test_rubocop_handler.vader
new file mode 100644
index 00000000..d77aa83c
--- /dev/null
+++ b/test/handler/test_rubocop_handler.vader
@@ -0,0 +1,44 @@
+Execute(The rubocop handler should parse lines correctly):
+ runtime ale_linters/ruby/rubocop.vim
+
+ AssertEqual
+ \ [
+ \ {
+ \ 'bufnr': 347,
+ \ 'lnum': 83,
+ \ 'col': 29,
+ \ 'text': 'Prefer single-quoted strings...',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'bufnr': 347,
+ \ 'lnum': 12,
+ \ 'col': 2,
+ \ 'text': 'Some error',
+ \ 'type': 'E',
+ \ },
+ \ {
+ \ 'bufnr': 347,
+ \ 'lnum': 10,
+ \ 'col': 5,
+ \ 'text': 'Regular warning',
+ \ 'type': 'W',
+ \ },
+ \ {
+ \ 'bufnr': 347,
+ \ 'lnum': 11,
+ \ 'col': 1,
+ \ 'text': 'Another error',
+ \ 'type': 'E',
+ \ },
+ \ ],
+ \ ale_linters#ruby#rubocop#Handle(347, [
+ \ 'This line should be ignored completely',
+ \ 'whatever:83:29: C: Prefer single-quoted strings...',
+ \ 'whatever:12:2: F: Some error',
+ \ 'whatever:10:5: W: Regular warning',
+ \ 'whatever:11:1: E: Another error',
+ \ ])
+
+After:
+ call ale#linter#Reset()