summaryrefslogtreecommitdiff
path: root/test/fixers
diff options
context:
space:
mode:
authorMiguel Palhas <mpalhas@gmail.com>2017-08-10 14:52:54 +0100
committerw0rp <w0rp@users.noreply.github.com>2017-08-10 14:52:54 +0100
commit0c26e8945cc662fb41ad3b2a808516a4501d1e07 (patch)
treee2e52f9ed7cd789ad05ff51c97ec35a59f7a98af /test/fixers
parent9ae2df195865e1f5ce3b1dab8b43c89e59ad471e (diff)
downloadale-0c26e8945cc662fb41ad3b2a808516a4501d1e07.zip
Rubocop fixer now uses g:ale_ruby_rubocop_options (#841)
* Rubocop fixer now uses g:ale_ruby_rubocop_options * Adds spec
Diffstat (limited to 'test/fixers')
-rw-r--r--test/fixers/test_rubocop_fixer_callback.vader17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/fixers/test_rubocop_fixer_callback.vader b/test/fixers/test_rubocop_fixer_callback.vader
index e3383537..e9a87395 100644
--- a/test/fixers/test_rubocop_fixer_callback.vader
+++ b/test/fixers/test_rubocop_fixer_callback.vader
@@ -21,7 +21,7 @@ Execute(The rubocop callback should return the correct default values):
\ {
\ 'read_temporary_file': 1,
\ 'command': ale#Escape(g:ale_ruby_rubocop_executable)
- \ . ' --auto-correct %t',
+ \ . ' --auto-correct %t ',
\ },
\ ale#fixers#rubocop#Fix(bufnr(''))
@@ -33,6 +33,19 @@ Execute(The rubocop callback should include configuration files):
\ 'read_temporary_file': 1,
\ 'command': ale#Escape(g:ale_ruby_rubocop_executable)
\ . ' --config ' . ale#Escape(g:dir . '/ruby_paths/with_config/.rubocop.yml')
- \ . ' --auto-correct %t',
+ \ . ' --auto-correct %t ',
+ \ },
+ \ ale#fixers#rubocop#Fix(bufnr(''))
+
+Execute(The rubocop callback should include custom rubocop options):
+ let g:ale_ruby_rubocop_options = '--except Lint/Debugger'
+ 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(g:dir . '/ruby_paths/with_config/.rubocop.yml')
+ \ . ' --auto-correct %t --except Lint/Debugger',
\ },
\ ale#fixers#rubocop#Fix(bufnr(''))