summaryrefslogtreecommitdiff
path: root/test/fixers/test_dhall_format_fixer_callback.vader
diff options
context:
space:
mode:
Diffstat (limited to 'test/fixers/test_dhall_format_fixer_callback.vader')
-rw-r--r--test/fixers/test_dhall_format_fixer_callback.vader27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/fixers/test_dhall_format_fixer_callback.vader b/test/fixers/test_dhall_format_fixer_callback.vader
new file mode 100644
index 00000000..02873473
--- /dev/null
+++ b/test/fixers/test_dhall_format_fixer_callback.vader
@@ -0,0 +1,27 @@
+Before:
+ Save g:ale_dhall_executable
+ Save g:ale_dhall_options
+
+ " Use an invalid global executable, so we don’t match it.
+ let g:ale_dhall_executable = 'odd-dhall'
+ let g:ale_dhall_options = '--ascii'
+
+ call ale#test#SetDirectory('/testplugin/test/dhall')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The dhall-format callback should return the correct options):
+ call ale#test#SetFilename('../dhall_files/testfile.dhall')
+
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('odd-dhall')
+ \ . ' --ascii'
+ \ . ' format'
+ \ . ' --inplace %t',
+ \ 'read_temporary_file': 1,
+ \ },
+ \ ale#fixers#dhall_format#Fix(bufnr(''))