summaryrefslogtreecommitdiff
path: root/test/fixers/test_alejandra_fixer_callback.vader
blob: ecbab6ffc0634207f75bff684f2a5d4133891ea1 (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_nix_alejandra_executable
  Save g:ale_nix_alejandra_options

After:
  Restore

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

Execute(The alejandra executable and options should be configurable):
  let g:ale_nix_alejandra_executable = '/path/to/alejandra'
  let g:ale_nix_alejandra_options = '-q'

  AssertEqual
  \ {
  \   'command': ale#Escape('/path/to/alejandra')
  \     . ' -q -- -',
  \ },
  \ ale#fixers#alejandra#Fix(bufnr(''))