summaryrefslogtreecommitdiff
path: root/test/fixers
diff options
context:
space:
mode:
Diffstat (limited to 'test/fixers')
-rw-r--r--test/fixers/test_html_beautify_fixer_callback.vader31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/fixers/test_html_beautify_fixer_callback.vader b/test/fixers/test_html_beautify_fixer_callback.vader
new file mode 100644
index 00000000..dacd1cb2
--- /dev/null
+++ b/test/fixers/test_html_beautify_fixer_callback.vader
@@ -0,0 +1,31 @@
+Before:
+ Save g:ale_html_beautify_executable
+ Save g:ale_html_beautify_options
+
+ let g:ale_html_beautify_options = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+ silent cd ..
+ silent cd command_callback
+ let g:dir = getcwd()
+
+After:
+ Restore
+
+ unlet! b:bin_dir
+
+ call ale#test#RestoreDirectory()
+
+Execute(The html-beautify callback should return 0 if html-beautify not found):
+ let g:ale_html_beautify_executable = 'xxxinvalidpath'
+ AssertEqual
+ \ 0,
+ \ ale#fixers#html_beautify#Fix(bufnr(''))
+
+Execute(The html-beautify callback should return the correct default command):
+ AssertEqual
+ \ {
+ \ 'command': ale#Escape('html_beautify_paths/html-beautify')
+ \ . ' -'
+ \ },
+ \ ale#fixers#html_beautify#Fix(bufnr(''))