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