diff options
author | w0rp <devw0rp@gmail.com> | 2017-07-09 22:43:25 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-07-09 22:43:31 +0100 |
commit | 6a84605c578ea844a02e429edb38ff2986bc308b (patch) | |
tree | a76cd146691fe7c11ae9576162091ab617ed2ba8 /test/command_callback/test_rubocop_command_callback.vader | |
parent | b50a7318fbf8836b820df9d10e0fc6ffba6bcd1e (diff) | |
download | ale-6a84605c578ea844a02e429edb38ff2986bc308b.zip |
Make every test set filenames and switch directories in the same way, and fix some missing escaping for the rubocop linter
Diffstat (limited to 'test/command_callback/test_rubocop_command_callback.vader')
-rw-r--r-- | test/command_callback/test_rubocop_command_callback.vader | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/test/command_callback/test_rubocop_command_callback.vader b/test/command_callback/test_rubocop_command_callback.vader index db151800..a88d453c 100644 --- a/test/command_callback/test_rubocop_command_callback.vader +++ b/test/command_callback/test_rubocop_command_callback.vader @@ -1,19 +1,33 @@ Before: + Save g:ale_ruby_rubocop_executable + + let g:ale_ruby_rubocop_executable = 'rubocop' + runtime ale_linters/ruby/rubocop.vim + call ale#test#SetDirectory('/testplugin/test/command_callback') + call ale#test#SetFilename('dummy.rb') + +After: + Restore + + call ale#test#RestoreDirectory() Execute(Executable should default to rubocop): AssertEqual - \ '''rubocop'' --format json --force-exclusion --stdin ''dummy.py''', + \ '''rubocop'' --format json --force-exclusion --stdin ' + \ . ale#Escape(g:dir . '/dummy.rb'), \ ale_linters#ruby#rubocop#GetCommand(bufnr('')) Execute(Should be able to set a custom executable): let g:ale_ruby_rubocop_executable = 'bin/rubocop' AssertEqual - \ '''bin/rubocop'' --format json --force-exclusion --stdin ''dummy.py''', + \ '''bin/rubocop'' --format json --force-exclusion --stdin ' + \ . ale#Escape(g:dir . '/dummy.rb'), \ ale_linters#ruby#rubocop#GetCommand(bufnr('')) Execute(Setting bundle appends 'exec rubocop'): let g:ale_ruby_rubocop_executable = 'path to/bundle' AssertEqual - \ '''path to/bundle'' exec rubocop --format json --force-exclusion --stdin ''dummy.py''', + \ '''path to/bundle'' exec rubocop --format json --force-exclusion --stdin ' + \ . ale#Escape(g:dir . '/dummy.rb'), \ ale_linters#ruby#rubocop#GetCommand(bufnr('')) |