diff options
author | w0rp <devw0rp@gmail.com> | 2017-07-26 23:17:46 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-07-26 23:17:46 +0100 |
commit | ded1bc14df6ddacd373cf9fe635f8489b9fb4f69 (patch) | |
tree | 0f979b4046b34b05f894af131fc49fa4fb98cef3 /test/handler | |
parent | 810e884dbe18adbe355e4c88d30f40547433dec5 (diff) | |
download | ale-ded1bc14df6ddacd373cf9fe635f8489b9fb4f69.zip |
#810 Ignore output which isn't JSON for brakeman
Diffstat (limited to 'test/handler')
-rw-r--r-- | test/handler/test_brakeman_handler.vader | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/test/handler/test_brakeman_handler.vader b/test/handler/test_brakeman_handler.vader index 240a0990..02d70234 100644 --- a/test/handler/test_brakeman_handler.vader +++ b/test/handler/test_brakeman_handler.vader @@ -1,20 +1,15 @@ Before: - " Switch to the test rails directory. - let b:path = getcwd() - silent! cd /testplugin/test/handler - cd ../ruby_fixtures/valid_rails_app/app/models + call ale#test#SetDirectory('/testplugin/test/handler') + cd .. - runtime ale_linters/ruby/brakeman.vim + runtime ale_linters/ruby/brakeman.vim After: - " Switch back to whatever directory it was that we started on. - silent! 'cd ' . fnameescape(b:path) - unlet! b:path - - call ale#linter#Reset() + call ale#test#RestoreDirectory() + call ale#linter#Reset() Execute(The brakeman handler should parse JSON correctly): - silent file! thing.rb + call ale#test#SetFilename('ruby_fixtures/valid_rails_app/app/models/thing.rb') AssertEqual \ [ @@ -78,3 +73,10 @@ Execute(The brakeman handler should parse JSON correctly when there is no output \ [], \ ale_linters#ruby#brakeman#Handle(347, [ \ ]) + \ +Execute(The brakeman handler should handle garbage output): + AssertEqual + \ [], + \ ale_linters#ruby#brakeman#Handle(347, [ + \ 'No such command in 2.4.1 of ruby', + \ ]) |