]> git.madduck.net Git - etc/vim.git/blob - test/fixers/test_elm_format_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:

Squashed '.vim/bundle/ale/' content from commit 22185c4c
[etc/vim.git] / test / fixers / test_elm_format_fixer_callback.vader
1 Before:
2   call ale#test#SetDirectory('/testplugin/test/fixers')
3
4 After:
5   unlet! b:ale_elm_format_executable
6   unlet! b:ale_elm_format_use_global
7   unlet! b:ale_elm_format_options
8
9   call ale#test#RestoreDirectory()
10
11 Execute(The elm-format command should have default params):
12   call ale#test#SetFilename('../test-files/elm/src/subdir/testfile.elm')
13
14   AssertEqual
15   \ {
16   \   'read_temporary_file': 1,
17   \   'command':
18   \     ale#Escape(ale#path#Simplify(g:dir . '/../test-files/elm/node_modules/.bin/elm-format'))
19   \     . ' %t --yes',
20   \ },
21   \ ale#fixers#elm_format#Fix(bufnr(''))
22
23 Execute(The elm-format command should manage use_global = 1 param):
24   call ale#test#SetFilename('../test-files/elm/src/subdir/testfile.elm')
25   let b:ale_elm_format_use_global = 1
26
27   AssertEqual
28   \ {
29   \   'read_temporary_file': 1,
30   \   'command':
31   \     ale#Escape('elm-format')
32   \     . ' %t --yes',
33   \ },
34   \ ale#fixers#elm_format#Fix(bufnr(''))
35
36 Execute(The elm-format command should manage executable param):
37   call ale#test#SetFilename('../test-files/elm/src/subdir/testfile.elm')
38   let b:ale_elm_format_use_global = 1
39   let b:ale_elm_format_executable = 'elmformat'
40
41   AssertEqual
42   \ {
43   \   'read_temporary_file': 1,
44   \   'command':
45   \     ale#Escape('elmformat')
46   \     . ' %t --yes',
47   \ },
48   \ ale#fixers#elm_format#Fix(bufnr(''))
49
50 Execute(The elm-format command should manage empty options):
51   call ale#test#SetFilename('../test-files/elm/src/subdir/testfile.elm')
52   let b:ale_elm_format_options = ''
53
54   AssertEqual
55   \ {
56   \   'read_temporary_file': 1,
57   \   'command':
58   \     ale#Escape(ale#path#Simplify(g:dir . '/../test-files/elm/node_modules/.bin/elm-format'))
59   \     . ' %t',
60   \ },
61   \ ale#fixers#elm_format#Fix(bufnr(''))
62
63 Execute(The elm-format command should manage custom options):
64   call ale#test#SetFilename('../test-files/elm/src/subdir/testfile.elm')
65   let b:ale_elm_format_options = '--param1 --param2'
66
67   AssertEqual
68   \ {
69   \   'read_temporary_file': 1,
70   \   'command':
71   \     ale#Escape(ale#path#Simplify(g:dir . '/../test-files/elm/node_modules/.bin/elm-format'))
72   \     . ' %t --param1 --param2',
73   \ },
74   \ ale#fixers#elm_format#Fix(bufnr(''))