]> git.madduck.net Git - etc/vim.git/blob - test/linter/test_htmlhint.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Squashed '.vim/bundle/ale/' content from commit 22185c4c
[etc/vim.git] / test / linter / test_htmlhint.vader
1 Before:
2   call ale#assert#SetUpLinterTest('html', 'htmlhint')
3   call ale#test#SetFilename('../test-files/htmlhint/test.html')
4
5   let g:node_executable = ale#path#Simplify(
6   \ g:dir . '/../test-files/htmlhint/node_modules/.bin/htmlhint'
7   \)
8   let g:config_path = ale#path#Simplify(
9   \ g:dir . '/../test-files/htmlhint/with_config/.htmlhintrc'
10   \)
11
12 After:
13   unlet! g:node_executable
14   unlet! g:config_path
15
16   call ale#assert#TearDownLinterTest()
17
18 Execute(The default command should be correct):
19   AssertLinter g:node_executable,
20   \ ale#Escape(g:node_executable) . ' --format=unix %t'
21
22 Execute(The global executable should be used if the option is set):
23   let g:ale_html_htmlhint_executable = 'foo'
24   let g:ale_html_htmlhint_use_global = 1
25
26   AssertLinter 'foo', ale#Escape('foo') . ' --format=unix %t',
27
28 " This is so old configurations which might include this still work.
29 Execute(--format=unix should be removed from the options if added):
30   let g:ale_html_htmlhint_options = '--format=unix'
31
32   AssertLinter g:node_executable,
33   \ ale#Escape(g:node_executable) . ' --format=unix %t'
34
35 Execute(The configuration file should be automatically detected):
36   call ale#test#SetFilename('../test-files/htmlhint/with_config/test.html')
37
38   AssertLinter g:node_executable,
39   \ ale#Escape(g:node_executable)
40   \   . '  --config ' . ale#Escape(g:config_path)
41   \   . ' --format=unix %t'
42
43 " This is so old configurations which might include the config will work.
44 Execute(The configuration file should be configurable through the options variable):
45   call ale#test#SetFilename('../test-files/htmlhint/with_config/test.html')
46   let g:ale_html_htmlhint_options = '--config=/foo/bar/.htmlhintrc'
47
48   AssertLinter g:node_executable,
49   \ ale#Escape(g:node_executable)
50   \   . ' --config=/foo/bar/.htmlhintrc'
51   \   . ' --format=unix %t'