2017-05-05 05:05:53 -04:00
|
|
|
Before:
|
2018-07-15 13:24:53 -04:00
|
|
|
call ale#assert#SetUpLinterTest('ruby', 'brakeman')
|
2017-05-05 05:05:53 -04:00
|
|
|
|
|
|
|
After:
|
2018-07-15 13:24:53 -04:00
|
|
|
call ale#assert#TearDownLinterTest()
|
2017-05-05 05:05:53 -04:00
|
|
|
|
|
|
|
Execute(The brakeman command callback should detect absence of a valid Rails app):
|
2017-06-21 17:33:34 -04:00
|
|
|
call ale#test#SetFilename('../ruby_fixtures/not_a_rails_app/test.rb')
|
|
|
|
|
2018-07-15 13:24:53 -04:00
|
|
|
AssertLinter 'brakeman', ''
|
2017-05-05 05:05:53 -04:00
|
|
|
|
|
|
|
Execute(The brakeman command callback should find a valid Rails app root):
|
2017-06-21 17:33:34 -04:00
|
|
|
call ale#test#SetFilename('../ruby_fixtures/valid_rails_app/db/test.rb')
|
|
|
|
|
2018-08-24 11:33:59 -04:00
|
|
|
AssertLinter 'brakeman', ale#Escape('brakeman')
|
|
|
|
\ . ' -f json -q -p '
|
2018-07-15 13:24:53 -04:00
|
|
|
\ . ale#Escape(ale#path#Simplify(g:dir . '/../ruby_fixtures/valid_rails_app'))
|
2017-05-05 05:05:53 -04:00
|
|
|
|
|
|
|
Execute(The brakeman command callback should include configured options):
|
2017-06-21 17:33:34 -04:00
|
|
|
call ale#test#SetFilename('../ruby_fixtures/valid_rails_app/db/test.rb')
|
2017-05-05 05:05:53 -04:00
|
|
|
|
2017-06-21 17:33:34 -04:00
|
|
|
let g:ale_ruby_brakeman_options = '--combobulate'
|
2017-05-05 05:05:53 -04:00
|
|
|
|
2018-08-24 11:33:59 -04:00
|
|
|
AssertLinter 'brakeman', ale#Escape('brakeman')
|
|
|
|
\ . ' -f json -q --combobulate -p '
|
|
|
|
\ . ale#Escape(ale#path#Simplify(g:dir . '/../ruby_fixtures/valid_rails_app'))
|
|
|
|
|
|
|
|
Execute(Setting bundle appends 'exec brakeman'):
|
|
|
|
call ale#test#SetFilename('../ruby_fixtures/valid_rails_app/db/test.rb')
|
|
|
|
|
|
|
|
let g:ale_ruby_brakeman_executable = 'bundle'
|
|
|
|
let g:ale_ruby_brakeman_options = '--combobulate'
|
|
|
|
|
|
|
|
AssertLinter 'bundle', ale#Escape('bundle')
|
|
|
|
\ . ' exec brakeman'
|
|
|
|
\ . ' -f json -q --combobulate -p '
|
2018-07-15 13:24:53 -04:00
|
|
|
\ . ale#Escape(ale#path#Simplify(g:dir . '/../ruby_fixtures/valid_rails_app'))
|