summaryrefslogtreecommitdiff
path: root/test/fixers/test_tidy_fixer_callback.vader
blob: a588d75e1ac136191d07dfae8bee8bbd4aea3ebb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Before:
  Save g:ale_html_tidy_executable

  let g:ale_html_tidy_executable = '../test-files/tidy/tidy'

  call ale#test#SetDirectory('/testplugin/test/fixers')

  silent cd ..
  silent cd command_callback
  let g:dir = getcwd()

After:
  Restore

  call ale#test#RestoreDirectory()

Execute(The tidy callback should return 0 if tidy not found):
  let g:ale_html_tidy_executable = 'xxxinvalidpath'
  AssertEqual
  \ 0,
  \ ale#fixers#tidy#Fix(bufnr(''))

Execute(The tidy callback should return the correct default command):
  AssertEqual
  \ {
  \   'command': ale#Escape('../test-files/tidy/tidy')
  \     . ' -q --tidy-mark no --show-errors 0 --show-warnings 0'
  \ },
  \ ale#fixers#tidy#Fix(bufnr(''))