File: test_nickel_format_fixer_callback.vader

package info (click to toggle)
vim-ale 4.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,764 kB
  • sloc: sh: 499; python: 311; perl: 31; makefile: 4; xml: 4; javascript: 1
file content (27 lines) | stat: -rw-r--r-- 788 bytes parent folder | download
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(''))