summaryrefslogtreecommitdiff
path: root/test/fixers/test_rufo_fixer_callback.vader
diff options
context:
space:
mode:
authorHayato Kawai <fohte.hk@gmail.com>2018-03-11 13:33:57 +0900
committerHayato Kawai <fohte.hk@gmail.com>2018-03-11 13:33:57 +0900
commit7e1a9a98103b74badc593bd0fea3c4ab6976ce81 (patch)
treeba83e432d1c0d6ba92fa4ecbf50b69c6c14c1100 /test/fixers/test_rufo_fixer_callback.vader
parent0a0535546f4d9a0dfe02671630fdaba72ea5828d (diff)
downloadale-7e1a9a98103b74badc593bd0fea3c4ab6976ce81.zip
Add rufo fixer for ruby files
Diffstat (limited to 'test/fixers/test_rufo_fixer_callback.vader')
-rw-r--r--test/fixers/test_rufo_fixer_callback.vader33
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(''))