summaryrefslogtreecommitdiff
path: root/test/fixers/test_shfmt_fixer_callback.vader
blob: 5dc6e863576d6b24280ebf773136189a109a99f0 (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
Before:
  Save g:ale_sh_shfmt_executable
  Save g:ale_sh_shfmt_options

After:
  Restore

Execute(The shfmt callback should return the correct default values):
  AssertEqual
  \ {
  \   'command': ale#Escape('shfmt'),
  \ },
  \ ale#fixers#shfmt#Fix(bufnr(''))

Execute(The shfmt executable and options should be configurable):
  let g:ale_sh_shfmt_executable = 'foobar'
  let g:ale_sh_shfmt_options = '--some-option'

  AssertEqual
  \ {
  \   'command': ale#Escape('foobar')
  \     . ' --some-option',
  \ },
  \ ale#fixers#shfmt#Fix(bufnr(''))