summaryrefslogtreecommitdiff
path: root/test/fixers
diff options
context:
space:
mode:
authorMatthew Lanigan <rintaun@gmail.com>2019-07-13 12:37:48 -0400
committerw0rp <w0rp@users.noreply.github.com>2019-07-13 17:37:48 +0100
commitabb38955d3acd452e37c15e7bae62022d1153859 (patch)
tree3dbb6b8d04a13c26d6f067e7c56da0aa59bcac03 /test/fixers
parent6c47d7fc352659cd2dc869a9a46a04a8492fc829 (diff)
downloadale-abb38955d3acd452e37c15e7bae62022d1153859.zip
Add Sorbet ruby linter and fixer (#2614)
Diffstat (limited to 'test/fixers')
-rw-r--r--test/fixers/test_sorbet_fixer_callback.vader42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/fixers/test_sorbet_fixer_callback.vader b/test/fixers/test_sorbet_fixer_callback.vader
new file mode 100644
index 00000000..71870e4c
--- /dev/null
+++ b/test/fixers/test_sorbet_fixer_callback.vader
@@ -0,0 +1,42 @@
+
+Before:
+ Save g:ale_ruby_sorbet_executable
+ Save g:ale_ruby_sorbet_options
+
+ " Use an invalid global executable, so we don't match it.
+ let g:ale_ruby_sorbet_executable = 'xxxinvalid'
+ let g:ale_ruby_sorbet_options = ''
+
+ 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 sorbet callback should return the correct default values):
+ call ale#test#SetFilename('ruby_paths/dummy.rb')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_ruby_sorbet_executable)
+ \ . ' tc --autocorrect --file %t',
+ \ },
+ \ ale#fixers#sorbet#Fix(bufnr(''))
+
+Execute(The sorbet callback should include custom sorbet options):
+ let g:ale_ruby_sorbet_options = '--enable-experimental-lsp-hover'
+ call ale#test#SetFilename('ruby_paths/with_config/dummy.rb')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_ruby_sorbet_executable)
+ \ . ' tc --enable-experimental-lsp-hover'
+ \ . ' --autocorrect --file %t',
+ \ },
+ \ ale#fixers#sorbet#Fix(bufnr(''))