]> git.madduck.net Git - etc/vim.git/blob - test/fixers/test_pint_fixer.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 / fixers / test_pint_fixer.vader
1 Before: 
2   Save g:ale_php_pint_executable
3   Save g:ale_php_pint_options
4   let g:ale_php_pint_executable = 'pint'
5   let g:ale_php_pint_options = ''
6
7   call ale#test#SetDirectory('/testplugin/test/fixers')
8
9 After:
10   Restore
11
12   call ale#test#RestoreDirectory()
13
14
15 Execute(project with pint should use local by default):
16   call ale#test#SetFilename('../test-files/php/project-with-pint/test.php')
17
18   AssertEqual
19   \ ale#path#Simplify(g:dir . '/../test-files/php/project-with-pint/vendor/bin/pint'),
20   \ ale#fixers#pint#GetExecutable(bufnr(''))
21
22 Execute(use-global should override local detection):
23   let g:ale_php_pint_use_global = 1
24   call ale#test#SetFilename('../test-files/php/project-with-pint/test.php')
25
26   AssertEqual
27   \ 'pint',
28   \ ale#fixers#pint#GetExecutable(bufnr(''))
29
30 Execute(project without pint should use global):
31   call ale#test#SetFilename('../test-files/php/project-without-pint/test.php')
32
33   AssertEqual
34   \ 'pint',
35   \ ale#fixers#pint#GetExecutable(bufnr(''))
36
37
38
39
40 Execute(The pint callback should return the correct default values):
41   call ale#test#SetFilename('../test-files/php/project-without-pint/foo/test.php')
42
43   AssertEqual
44   \ {
45   \   'read_temporary_file': 1,
46   \   'command': ale#Escape('pint')
47   \      . ' ' . g:ale_php_pint_options
48   \      . ' %t'
49   \ },
50   \ ale#fixers#pint#Fix(bufnr(''))
51
52 Execute(The pint callback should include custom pint options):
53   let g:ale_php_pint_options = '--test'
54   call ale#test#SetFilename('../test-files/php/project-without-pint/test.php')
55
56   AssertEqual
57   \ {
58   \   'command': ale#Escape(g:ale_php_pint_executable)
59   \     . ' --test %t',
60   \   'read_temporary_file': 1,
61   \ },
62   \ ale#fixers#pint#Fix(bufnr(''))