summaryrefslogtreecommitdiff
path: root/test/fixers/test_jq_fixer_callback.vader
blob: 74580d3b6123ffcb3e669fe16cbcbe3fe0c73d45 (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
Before:
  Save g:ale_json_jq_executable
  Save g:ale_json_jq_options
  Save g:ale_json_jq_filters

After:
  Restore

Execute(The jq fixer should use the options you set):
  let g:ale_json_jq_executable = 'foo'
  let g:ale_json_jq_options = '--bar'
  let g:ale_json_jq_filters = '.baz'

  AssertEqual
  \ {'command': ale#Escape('foo') . ' .baz --bar'},
  \ ale#fixers#jq#Fix(bufnr(''))

Execute(The jq fixer should return 0 when there are no filters):
  let g:ale_json_jq_executable = 'jq'
  let g:ale_json_jq_options = ''

  let g:ale_json_jq_filters = ''

  AssertEqual
  \ 0,
  \ ale#fixers#jq#Fix(bufnr(''))