From 47eb3dd0c0bde414e76a36f270f9c59ce257559b Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Mon, 28 Oct 2019 14:25:36 +0100 Subject: Add support for html-beautify (#2788) * Add support for html-beautify * Add html-beautify to the list of supported tools * Update docs --- .../html_beautify_paths/html-beautify | 0 .../command_callback/html_beautify_paths/test.html | 0 .../fixers/test_html_beautify_fixer_callback.vader | 31 ++++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100755 test/command_callback/html_beautify_paths/html-beautify create mode 100644 test/command_callback/html_beautify_paths/test.html create mode 100644 test/fixers/test_html_beautify_fixer_callback.vader (limited to 'test') diff --git a/test/command_callback/html_beautify_paths/html-beautify b/test/command_callback/html_beautify_paths/html-beautify new file mode 100755 index 00000000..e69de29b diff --git a/test/command_callback/html_beautify_paths/test.html b/test/command_callback/html_beautify_paths/test.html new file mode 100644 index 00000000..e69de29b 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('')) -- cgit v1.2.3