summaryrefslogtreecommitdiff
path: root/test/fixers/test_nickel_format_fixer_callback.vader
blob: af3e0c26849c43837d53b5486c3a46344b679ad1 (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
Before:
  Save g:ale_nickel_nickel_format_executable
  Save g:ale_nickel_nickel_format_options
  Save &l:expandtab
  Save &l:shiftwidth
  Save &l:tabstop

After:
  Restore

Execute(The nickel_format callback should return 'nickel format' as default command):
  setlocal noexpandtab
  Assert
  \ ale#fixers#nickel_format#Fix(bufnr('')).command =~# '^' . ale#Escape('nickel') . ' format',
  \ "Default command name is expected to be 'nickel format'"

Execute(The nickel executable and options should be configurable):
  let g:ale_nickel_nickel_format_executable = 'foobar'
  let g:ale_nickel_nickel_format_options = '--some-option'

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