mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-26 22:11:12 +08:00
Make every test set filenames and switch directories in the same way, and fix some missing escaping for the rubocop linter
This commit is contained in:
@@ -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(''))
|
||||
|
||||
Reference in New Issue
Block a user