File: test_ruby_steep.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 (69 lines) | stat: -rw-r--r-- 2,319 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
" Author: Loic Nageleisen <https://github.com/lloeki>
" Description: Tests for steep linter.
Before:
  call ale#assert#SetUpLinterTest('ruby', 'steep')

  let g:ale_ruby_steep_executable = 'steep'

After:
  call ale#assert#TearDownLinterTest()

Execute(Executable should default to steep):
  call ale#test#SetFilename('../test-files/ruby/nested/foo/dummy.rb')
  AssertLinter 'steep', ale#Escape('steep')
  \   . ' check '
  \   . ' dummy.rb'

Execute(Should be able to set a custom executable):
  let g:ale_ruby_steep_executable = 'bin/steep'

  call ale#test#SetFilename('../test-files/ruby/nested/foo/dummy.rb')
  AssertLinter 'bin/steep' , ale#Escape('bin/steep')
  \   . ' check '
  \   . ' dummy.rb'

Execute(Setting bundle appends 'exec steep'):
  let g:ale_ruby_steep_executable = 'path to/bundle'

  call ale#test#SetFilename('../test-files/ruby/nested/foo/dummy.rb')
  AssertLinter 'path to/bundle', ale#Escape('path to/bundle')
  \   . ' exec steep'
  \   . ' check '
  \   . ' dummy.rb'

Execute(should accept options):
  let g:ale_ruby_steep_options = '--severity-level=hint'

  call ale#test#SetFilename('../test-files/ruby/nested/foo/dummy.rb')
  AssertLinter 'steep', ale#Escape('steep')
  \   . ' check'
  \   . ' --severity-level=hint'
  \   . ' dummy.rb'

Execute(Should not lint files out of steep root):
  call ale#test#SetFilename('../test-files/ruby/nested/dummy.rb')
  AssertLinter 'steep', ''

Execute(Should lint files at top steep root):
  call ale#test#SetFilename('../test-files/ruby/nested/foo/dummy.rb')
  AssertLinter 'steep', ale#Escape('steep')
  \   . ' check '
  \   . ' dummy.rb'

Execute(Should lint files below top steep root):
  call ale#test#SetFilename('../test-files/ruby/nested/foo/one/dummy.rb')
  AssertLinter 'steep', ale#Escape('steep')
  \   . ' check '
  \   . ' one' . (has('win32') ? '\' : '/') . 'dummy.rb'

Execute(Should lint files at nested steep root):
  call ale#test#SetFilename('../test-files/ruby/nested/foo/two/dummy.rb')
  AssertLinter 'steep', ale#Escape('steep')
  \   . ' check '
  \   . ' dummy.rb'

Execute(Should lint files below nested steep root):
  call ale#test#SetFilename('../test-files/ruby/nested/foo/two/three/dummy.rb')
  AssertLinter 'steep', ale#Escape('steep')
  \   . ' check '
  \   . ' three' . (has('win32') ? '\' : '/') . 'dummy.rb'