summaryrefslogtreecommitdiff
path: root/test/command_callback/test_reek_command_callback.vader
blob: 41e749c11e78cd57217d57fe0f17a472faf9ec65 (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
Before:
  runtime ale_linters/ruby/reek.vim
  call ale#test#SetDirectory('/testplugin/test/command_callback')

After:
  call ale#test#RestoreDirectory()
  call ale#linter#Reset()
  call ale#semver#ResetVersionCache()

Execute(The reek callbacks should return the correct default values):
  AssertEqual
  \ 'reek --version',
  \ ale_linters#ruby#reek#VersionCheck(bufnr(''))
  AssertEqual
  \ 'reek -f json --no-progress --no-color --stdin-filename %s',
  \ ale_linters#ruby#reek#GetCommand(bufnr(''), ['reek 5.0.0'])

  " Try with older versions.
  call ale#semver#ResetVersionCache()
  AssertEqual
  \ 'reek -f json --no-progress --no-color',
  \ ale_linters#ruby#reek#GetCommand(bufnr(''), ['reek 4.8.2'])

Execute(The reek version check should be cached):
  AssertEqual
  \ 'reek -f json --no-progress --no-color --stdin-filename %s',
  \ ale_linters#ruby#reek#GetCommand(bufnr(''), ['reek 5.0.0'])

  AssertEqual
  \ '',
  \ ale_linters#ruby#reek#VersionCheck(bufnr(''))
  AssertEqual
  \ 'reek -f json --no-progress --no-color --stdin-filename %s',
  \ ale_linters#ruby#reek#GetCommand(bufnr(''), [])