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

Do not set EDITOR/VISUAL for shell
[etc/vim.git] / .vim / bundle / ale / test / fixers / test_djlint_fixer_callback.vader
1 Before:
2   call ale#assert#SetUpFixerTest('html', 'djlint', 'djlint')
3
4 After:
5   Restore
6
7   call ale#assert#TearDownFixerTest()
8
9 Execute(The djlint callback should return the correct default command):
10   AssertEqual
11   \ {'command': ale#Escape('djlint') . ' --reformat  -'},
12   \ ale#fixers#djlint#Fix(bufnr(''))
13
14 Execute(The --profile option should not be overridden):
15   call ale#test#SetFilename('../test-files/djlint/testfile.html')
16
17   set filetype=htmldjango
18   let g:ale_html_djlint_options = '--profile jinja'
19
20   AssertFixer
21   \ { 'command': ale#Escape(g:ale_html_djlint_executable)
22   \     . ' --reformat'
23   \     . ' --profile jinja'
24   \     . ' -',
25   \ }
26
27
28 Execute(Should set --profile for experimental language, Handlebars):
29   call ale#test#SetFilename('../test-files/djlint/testfile.hbs')
30
31   set filetype=handlebars
32
33   AssertFixer
34   \ { 'command': ale#Escape(g:ale_html_djlint_executable)
35   \     . ' --reformat'
36   \     . ' --profile handlebars'
37   \     . ' -',
38   \ }
39
40 Execute(Should set --profile for htmldjango, Django templates):
41   call ale#test#SetFilename('../test-files/djlint/testfile.html')
42
43   set filetype=htmldjango
44
45   AssertFixer
46   \ { 'command': ale#Escape(g:ale_html_djlint_executable)
47   \     . ' --reformat'
48   \     . ' --profile django'
49   \     . ' -',
50   \ }
51
52 Execute(Should set --profile for htmlangular):
53   call ale#test#SetFilename('../test-files/djlint/testfile.html')
54
55   set filetype=htmlangular
56
57   AssertFixer
58   \ { 'command': ale#Escape(g:ale_html_djlint_executable)
59   \     . ' --reformat'
60   \     . ' --profile angular'
61   \     . ' -',
62   \ }
63
64 Execute(Should set --profile for jinja):
65   call ale#test#SetFilename('../test-files/djlint/testfile.jinja2')
66
67   set filetype=jinja
68
69   AssertFixer
70   \ { 'command': ale#Escape(g:ale_html_djlint_executable)
71   \     . ' --reformat'
72   \     . ' --profile jinja'
73   \     . ' -',
74   \ }
75
76 Execute(Should set --profile for nunjucks):
77   call ale#test#SetFilename('../test-files/djlint/testfile.njk')
78
79   set filetype=nunjucks
80
81   AssertFixer
82   \ { 'command': ale#Escape(g:ale_html_djlint_executable)
83   \     . ' --reformat'
84   \     . ' --profile nunjucks'
85   \     . ' -',
86   \ }
87
88 Execute(Should set --profile for Go HTML templates):
89   call ale#test#SetFilename('../test-files/djlint/testfile.html')
90
91   set filetype=gohtmltmpl
92
93   AssertFixer
94   \ { 'command': ale#Escape(g:ale_html_djlint_executable)
95   \     . ' --reformat'
96   \     . ' --profile golang'
97   \     . ' -',
98   \ }