]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/fixers/test_ktlint_fixer_callback.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 / fixers / test_ktlint_fixer_callback.vader
1 Before:
2   Save g:ale_kotlin_ktlint_executable
3   Save g:ale_kotlin_ktlint_options
4   Save g:ale_kotlin_ktlint_rulesets
5
6   " Use an invalid global executable, so we don't match it.
7   let g:ale_kotlin_ktlint_executable = 'xxxinvalid'
8   let g:ale_kotlin_ktlint_options = ''
9   let g:ale_kotlin_ktlint_rulesets = []
10
11   call ale#test#SetDirectory('/testplugin/test/fixers')
12
13 After:
14   Restore
15
16   call ale#test#RestoreDirectory()
17
18 Execute(The ktlint callback should return the correct default values):
19   call ale#test#SetFilename('../test-files/kotlin/testfile.kt')
20
21   AssertEqual
22   \ {
23   \   'command': ale#Escape('xxxinvalid')
24   \     . ' --stdin'
25   \     . ' --format',
26   \ },
27   \ ale#fixers#ktlint#Fix(bufnr(''))
28
29 Execute(The ktlint callback should include custom ktlint options):
30   let g:ale_kotlin_ktlint_options = "--android"
31   let g:ale_kotlin_ktlint_rulesets = ['/path/to/custom/ruleset.jar']
32   call ale#test#SetFilename('../test-files/kotlin/testfile.kt')
33
34   AssertEqual
35   \ {
36   \   'command': ale#Escape('xxxinvalid')
37   \     . ' ' . g:ale_kotlin_ktlint_options
38   \     . ' --ruleset /path/to/custom/ruleset.jar'
39   \     . ' --stdin'
40   \     . ' --format',
41   \ },
42   \ ale#fixers#ktlint#Fix(bufnr(''))