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):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/ruby/not_a_rails_app/test.rb')
|
2017-06-21 21:33:34 +00:00
|
|
|
|
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):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/ruby/valid_rails_app/db/test.rb')
|
2017-06-21 21:33:34 +00:00
|
|
|
|
2018-08-24 15:33:59 +00:00
|
|
|
AssertLinter 'brakeman', ale#Escape('brakeman')
|
|
|
|
\ . ' -f json -q -p '
|
2021-03-20 22:11:22 +00:00
|
|
|
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/ruby/valid_rails_app'))
|
2017-05-05 09:05:53 +00:00
|
|
|
|
|
|
|
Execute(The brakeman command callback should include configured options):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/ruby/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 '
|
2021-03-20 22:11:22 +00:00
|
|
|
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/ruby/valid_rails_app'))
|
2018-08-24 15:33:59 +00:00
|
|
|
|
|
|
|
Execute(Setting bundle appends 'exec brakeman'):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/ruby/valid_rails_app/db/test.rb')
|
2018-08-24 15:33:59 +00:00
|
|
|
|
|
|
|
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 '
|
2021-03-20 22:11:22 +00:00
|
|
|
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/ruby/valid_rails_app'))
|