summaryrefslogtreecommitdiff
path: root/test/fixers/test_sqlfmt_fixer_callback.vader
diff options
context:
space:
mode:
Diffstat (limited to 'test/fixers/test_sqlfmt_fixer_callback.vader')
-rw-r--r--test/fixers/test_sqlfmt_fixer_callback.vader26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/fixers/test_sqlfmt_fixer_callback.vader b/test/fixers/test_sqlfmt_fixer_callback.vader
new file mode 100644
index 00000000..3046edb3
--- /dev/null
+++ b/test/fixers/test_sqlfmt_fixer_callback.vader
@@ -0,0 +1,26 @@
+Before:
+ Save g:ale_sql_sqlfmt_executable
+ Save g:ale_sql_sqlfmt_options
+
+After:
+ Restore
+
+Execute(The sqlfmt callback should return the correct default values):
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('sqlfmt')
+ \ . ' -w',
+ \ },
+ \ ale#fixers#sqlfmt#Fix(bufnr(''))
+
+Execute(The sqlfmt executable and options should be configurable):
+ let g:ale_sql_sqlfmt_executable = '/path/to/sqlfmt'
+ let g:ale_sql_sqlfmt_options = '-u'
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('/path/to/sqlfmt')
+ \ . ' -w'
+ \ . ' -u',
+ \ },
+ \ ale#fixers#sqlfmt#Fix(bufnr(''))