diff options
author | w0rp <w0rp@users.noreply.github.com> | 2018-03-18 17:42:07 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-18 17:42:07 +0000 |
commit | 434f22e44a1ed5a5be2628c1fdd5906cf1c9bc46 (patch) | |
tree | ad8286d9bb7c08668a5a0d59f40b452e374c9575 /test | |
parent | 440502dc939dc817cce1018619019b33c9b0fd42 (diff) | |
parent | 7e1a9a98103b74badc593bd0fea3c4ab6976ce81 (diff) | |
download | ale-434f22e44a1ed5a5be2628c1fdd5906cf1c9bc46.zip |
Merge pull request #1415 from fohte/fixer-rufo
Add rufo fixer for Ruby files
Diffstat (limited to 'test')
-rw-r--r-- | test/fixers/test_rufo_fixer_callback.vader | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/fixers/test_rufo_fixer_callback.vader b/test/fixers/test_rufo_fixer_callback.vader new file mode 100644 index 00000000..a0828406 --- /dev/null +++ b/test/fixers/test_rufo_fixer_callback.vader @@ -0,0 +1,33 @@ +Before: + Save g:ale_ruby_rufo_executable + + " Use an invalid global executable, so we don't match it. + let g:ale_ruby_rufo_executable = 'xxxinvalid' + + call ale#test#SetDirectory('/testplugin/test/fixers') + silent cd .. + silent cd command_callback + let g:dir = getcwd() + +After: + Restore + + call ale#test#RestoreDirectory() + +Execute(The rufo command should contain `bundle exec` when executable is `bundle`): + let g:ale_ruby_rufo_executable = 'bundle' + call ale#test#SetFilename('ruby_paths/dummy.rb') + + AssertEqual + \ ale#Escape('bundle') . ' exec rufo %t', + \ ale#fixers#rufo#GetCommand(bufnr('')) + +Execute(The rufo callback should return the correct default values): + call ale#test#SetFilename('ruby_paths/dummy.rb') + + AssertEqual + \ { + \ 'read_temporary_file': 1, + \ 'command': ale#Escape('xxxinvalid') . ' %t' + \ }, + \ ale#fixers#rufo#Fix(bufnr('')) |