summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2018-09-14 13:27:07 +0100
committerGitHub <noreply@github.com>2018-09-14 13:27:07 +0100
commit7f1c411b5e5ef978e7bf4d032e6bd1ddeabb20c5 (patch)
tree92fc306223bcc1dda9f1826dbce7119cae37c246 /test
parent43d7e8fde9aedb5dc3d76014a64de04fbdbaa276 (diff)
parentb01470cbbcfb64ba2ca5b23016e6c9e8702fb0ce (diff)
downloadale-7f1c411b5e5ef978e7bf4d032e6bd1ddeabb20c5.zip
Merge pull request #1850 from rrosenblum/ruby_linters
Update all Ruby linters to work consistently with bundler
Diffstat (limited to 'test')
-rw-r--r--test/command_callback/test_brakeman_command_callback.vader17
-rw-r--r--test/command_callback/test_reek_command_callback.vader30
2 files changed, 38 insertions, 9 deletions
diff --git a/test/command_callback/test_brakeman_command_callback.vader b/test/command_callback/test_brakeman_command_callback.vader
index 61be4caf..15dbbe1c 100644
--- a/test/command_callback/test_brakeman_command_callback.vader
+++ b/test/command_callback/test_brakeman_command_callback.vader
@@ -12,7 +12,8 @@ Execute(The brakeman command callback should detect absence of a valid Rails app
Execute(The brakeman command callback should find a valid Rails app root):
call ale#test#SetFilename('../ruby_fixtures/valid_rails_app/db/test.rb')
- AssertLinter 'brakeman', 'brakeman -f json -q -p '
+ AssertLinter 'brakeman', ale#Escape('brakeman')
+ \ . ' -f json -q -p '
\ . ale#Escape(ale#path#Simplify(g:dir . '/../ruby_fixtures/valid_rails_app'))
Execute(The brakeman command callback should include configured options):
@@ -20,5 +21,17 @@ Execute(The brakeman command callback should include configured options):
let g:ale_ruby_brakeman_options = '--combobulate'
- AssertLinter 'brakeman', 'brakeman -f json -q --combobulate -p '
+ 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 '
\ . ale#Escape(ale#path#Simplify(g:dir . '/../ruby_fixtures/valid_rails_app'))
diff --git a/test/command_callback/test_reek_command_callback.vader b/test/command_callback/test_reek_command_callback.vader
index 059e5e36..963247aa 100644
--- a/test/command_callback/test_reek_command_callback.vader
+++ b/test/command_callback/test_reek_command_callback.vader
@@ -7,8 +7,8 @@ After:
Execute(The reek callbacks should return the correct default values):
WithChainResults ['reek 5.0.0']
AssertLinter 'reek', [
- \ 'reek --version',
- \ 'reek -f json --no-progress --no-color --stdin-filename %s',
+ \ ale#Escape('reek') . ' --version',
+ \ ale#Escape('reek') . ' -f json --no-progress --no-color --stdin-filename %s',
\]
" Try with older versions.
@@ -16,19 +16,35 @@ Execute(The reek callbacks should return the correct default values):
WithChainResults ['reek 4.8.2']
AssertLinter 'reek', [
- \ 'reek --version',
- \ 'reek -f json --no-progress --no-color',
+ \ ale#Escape('reek') . ' --version',
+ \ ale#Escape('reek') . ' -f json --no-progress --no-color',
\]
+Execute(Setting bundle appends 'exec reek'):
+ let g:ale_ruby_reek_executable = 'bundle'
+
+ WithChainResults ['reek 5.0.0']
+ AssertLinter 'bundle', ale#Escape('bundle')
+ \ . ' exec reek'
+ \ . ' -f json --no-progress --no-color --stdin-filename %s',
+
+ " Try with older versions.
+ call ale#semver#ResetVersionCache()
+
+ WithChainResults ['reek 4.8.2']
+ AssertLinter 'bundle', ale#Escape('bundle')
+ \ . ' exec reek'
+ \ . ' -f json --no-progress --no-color'
+
Execute(The reek version check should be cached):
WithChainResults ['reek 5.0.0']
AssertLinter 'reek', [
- \ 'reek --version',
- \ 'reek -f json --no-progress --no-color --stdin-filename %s',
+ \ ale#Escape('reek') . ' --version',
+ \ ale#Escape('reek') . ' -f json --no-progress --no-color --stdin-filename %s',
\]
WithChainResults []
AssertLinter 'reek', [
\ '',
- \ 'reek -f json --no-progress --no-color --stdin-filename %s',
+ \ ale#Escape('reek') . ' -f json --no-progress --no-color --stdin-filename %s',
\]