summaryrefslogtreecommitdiff
path: root/test/fixers/test_rubyfmt_fixer_callback.vader
diff options
context:
space:
mode:
Diffstat (limited to 'test/fixers/test_rubyfmt_fixer_callback.vader')
-rw-r--r--test/fixers/test_rubyfmt_fixer_callback.vader26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/fixers/test_rubyfmt_fixer_callback.vader b/test/fixers/test_rubyfmt_fixer_callback.vader
new file mode 100644
index 00000000..e211640f
--- /dev/null
+++ b/test/fixers/test_rubyfmt_fixer_callback.vader
@@ -0,0 +1,26 @@
+Before:
+ Save g:ale_ruby_rubyfmt_executable
+ Save g:ale_ruby_rubyfmt_options
+ Save &l:expandtab
+ Save &l:shiftwidth
+ Save &l:tabstop
+
+After:
+ Restore
+
+Execute(The rubyfmt callback should return 'rubyfmt' as default command):
+ setlocal noexpandtab
+ Assert
+ \ ale#fixers#rubyfmt#Fix(bufnr('')).command =~# '^' . ale#Escape('rubyfmt'),
+ \ "Default command name is expected to be 'rubyfmt'"
+
+Execute(The ruby executable and options should be configurable):
+ let g:ale_ruby_rubyfmt_executable = 'foobar'
+ let g:ale_ruby_rubyfmt_options = '--some-option'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('foobar')
+ \ . ' --some-option',
+ \ },
+ \ ale#fixers#rubyfmt#Fix(bufnr(''))