summaryrefslogtreecommitdiff
path: root/test/fixers
diff options
context:
space:
mode:
authorLEI <guillaume.frichet@gmail.com>2018-09-08 00:55:26 +0200
committerLEI <guillaume.frichet@gmail.com>2018-09-08 01:34:10 +0200
commita97ef49c5174f5d60f2dc68718d96965361f3d4e (patch)
treeaddef6b9a9b5b41fe81a5632c4eba95ba047378c /test/fixers
parent0ae4ea23c8573f9c693fcd5cd5ff9a3acc795b58 (diff)
downloadale-a97ef49c5174f5d60f2dc68718d96965361f3d4e.zip
Add support for sqlfmt
Diffstat (limited to 'test/fixers')
-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(''))