]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/linter/test_html_stylelint.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:

Do not set EDITOR/VISUAL for shell
[etc/vim.git] / .vim / bundle / ale / test / linter / test_html_stylelint.vader
1 Before:
2   Save g:ale_html_stylelint_executable
3   Save g:ale_html_stylelint_use_global
4   Save g:ale_html_stylelint_options
5
6   unlet! b:executable
7
8   unlet! g:ale_html_stylelint_executable
9   unlet! g:ale_html_stylelint_use_global
10   unlet! g:ale_html_stylelint_options
11
12   call ale#test#SetDirectory('/testplugin/test/linter')
13   call ale#test#SetFilename('testfile.html')
14
15   runtime ale_linters/html/stylelint.vim
16
17 After:
18   Restore
19
20   unlet! b:executable
21   unlet! b:ale_html_stylelint_executable
22   unlet! b:ale_html_stylelint_use_global
23   unlet! b:ale_html_stylelint_options
24
25   call ale#test#SetFilename('test.txt')
26
27   call ale#test#RestoreDirectory()
28   call ale#linter#Reset()
29
30 Execute(node_modules directories should be discovered):
31   call ale#test#SetFilename('../test-files/stylelint/nested/testfile.html')
32
33   let b:executable = ale#path#Simplify(
34   \   g:dir
35   \   . '/../test-files/stylelint/node_modules/.bin/stylelint'
36   \)
37
38   AssertEqual b:executable, ale_linters#html#stylelint#GetExecutable(bufnr(''))
39   AssertEqual
40   \ ale#Escape(b:executable) . ' --stdin-filename %s',
41   \ ale_linters#html#stylelint#GetCommand(bufnr(''))
42
43 Execute(The global override should work):
44   let b:ale_html_stylelint_executable = 'foobar'
45   let b:ale_html_stylelint_use_global = 1
46
47   call ale#test#SetFilename('../test-files/stylelint/nested/testfile.html')
48
49   AssertEqual 'foobar', ale_linters#html#stylelint#GetExecutable(bufnr(''))
50   AssertEqual
51   \ ale#Escape('foobar') . ' --stdin-filename %s',
52   \ ale_linters#html#stylelint#GetCommand(bufnr(''))
53
54 Execute(Extra options should be configurable):
55   let b:ale_html_stylelint_options = '--whatever'
56
57   AssertEqual 'stylelint', ale_linters#html#stylelint#GetExecutable(bufnr(''))
58   AssertEqual
59   \ ale#Escape('stylelint') . ' --whatever --stdin-filename %s',
60   \ ale_linters#html#stylelint#GetCommand(bufnr(''))