summaryrefslogtreecommitdiff
path: root/test/fixers
diff options
context:
space:
mode:
authorNihad Abbasov <nihad@42na.in>2020-08-12 16:04:54 +0300
committerGitHub <noreply@github.com>2020-08-12 14:04:54 +0100
commitd5912b53ddd30102c6e199468998fb6d72a197f3 (patch)
tree75a44379d7f0f953ca3b1672869a65d933f627c3 /test/fixers
parentd3f410b6f723603bb3bcd121758868deae37ba94 (diff)
downloadale-d5912b53ddd30102c6e199468998fb6d72a197f3.zip
Restore old behavior of ALEFix command for Rubocop (#3237)
* Restore old behavior of ALEFix command for Rubocop Since RuboCop 0.60 ALEFix command stopped to fix all found offenses. This change restores the previous behavior by allowing rubocop to fix all detected offenses. * Fix tests * Allow to configure auto-correct option for Rubocop
Diffstat (limited to 'test/fixers')
-rw-r--r--test/fixers/test_rubocop_fixer_callback.vader13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/fixers/test_rubocop_fixer_callback.vader b/test/fixers/test_rubocop_fixer_callback.vader
index 866326bf..b1925000 100644
--- a/test/fixers/test_rubocop_fixer_callback.vader
+++ b/test/fixers/test_rubocop_fixer_callback.vader
@@ -52,3 +52,16 @@ Execute(The rubocop callback should include custom rubocop options):
\ . ' --auto-correct --force-exclusion %t',
\ },
\ ale#fixers#rubocop#Fix(bufnr(''))
+
+Execute(The rubocop callback should use auto-correct-all option when set):
+ let g:ale_ruby_rubocop_auto_correct_all = 1
+ call ale#test#SetFilename('ruby_paths/with_config/dummy.rb')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_ruby_rubocop_executable)
+ \ . ' --config ' . ale#Escape(ale#path#Simplify(g:dir . '/ruby_paths/with_config/.rubocop.yml'))
+ \ . ' --auto-correct-all --force-exclusion %t',
+ \ },
+ \ ale#fixers#rubocop#Fix(bufnr(''))