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

Merge commit '56df844d3c39ec494dacc69eae34272b27db185a' as '.vim/bundle/asyncomplete'
[etc/vim.git] / .vim / bundle / ale / test / linter / test_write_good.vader
1 Before:
2   " This is just one example of a language using the linter.
3   call ale#assert#SetUpLinterTest('markdown', 'writegood')
4
5   " The options are shared between many languages.
6   Save g:ale_writegood_options
7   Save g:ale_writegood_executable
8   Save g:ale_writegood_use_global
9
10   unlet! g:ale_writegood_options
11   unlet! g:ale_writegood_executable
12   unlet! g:ale_writegood_use_global
13
14   call ale#test#SetFilename('testfile.txt')
15   call ale#handlers#writegood#ResetOptions()
16
17 After:
18   call ale#assert#TearDownLinterTest()
19
20 Execute(The global executable should be used when the local one cannot be found):
21   AssertLinter
22   \ 'write-good',
23   \ ale#Escape('write-good') . ' %t',
24
25 Execute(The options should be used in the command):
26   let g:ale_writegood_options = '--foo --bar'
27
28   AssertLinter
29   \ 'write-good',
30   \ ale#Escape('write-good') . ' --foo --bar %t',
31
32 Execute(Should use the node_modules/.bin executable, if available):
33   call ale#test#SetFilename('../test-files/write-good/node-modules/test.txt')
34
35   AssertLinter
36   \ ale#path#Simplify(g:dir . '/../test-files/write-good/node-modules/node_modules/.bin/write-good'),
37   \ ale#Escape(ale#path#Simplify(g:dir . '/../test-files/write-good/node-modules/node_modules/.bin/write-good'))
38   \   . ' %t',
39
40 Execute(Should use the node_modules/write-good executable, if available):
41   call ale#test#SetFilename('../test-files/write-good/node-modules-2/test.txt')
42
43   AssertLinter
44   \ ale#path#Simplify(g:dir . '/../test-files/write-good/node-modules-2/node_modules/write-good/bin/write-good.js'),
45   \   (has('win32') ? 'node.exe ' : '')
46   \   . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/write-good/node-modules-2/node_modules/write-good/bin/write-good.js'))
47   \   . ' %t',
48
49 Execute(Should let users configure a global executable and override local paths):
50   call ale#test#SetFilename('../test-files/write-good/node-modules-2/test.txt')
51
52   let g:ale_writegood_executable = 'foo-bar'
53   let g:ale_writegood_use_global = 1
54
55   AssertLinter 'foo-bar', ale#Escape('foo-bar') . ' %t'