summaryrefslogtreecommitdiff
path: root/test/command_callback/test_scalastyle_command_callback.vader
blob: 953d57b328c40e026f64119fab13f2bc9a08ae49 (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
28
29
30
31
32
33
34
35
36
Before:
  Save g:ale_scala_scalastyle_options
  Save g:ale_scalastyle_config_loc

  unlet! g:ale_scala_scalastyle_options
  unlet! g:ale_scalastyle_config_loc

  runtime ale_linters/scala/scalastyle.vim

After:
  Restore

  call ale#linter#Reset()

Execute(Should return the correct default command):
  AssertEqual
  \   'scalastyle %t',
  \   ale_linters#scala#scalastyle#GetCommand(bufnr(''))

Execute(Should allow using a custom config file):
  let g:ale_scalastyle_config_loc = '/dooper/config.xml'

  AssertEqual
  \   'scalastyle'
  \     . ' --config ' . ale#Escape('/dooper/config.xml')
  \     . ' %t',
  \   ale_linters#scala#scalastyle#GetCommand(bufnr(''))

Execute(Should allow using custom options):
  let g:ale_scala_scalastyle_options = '--warnings false --quiet true'

  AssertEqual
  \   'scalastyle'
  \     . ' --warnings false --quiet true'
  \     . ' %t',
  \   ale_linters#scala#scalastyle#GetCommand(bufnr(''))