File: test_packwerk_handler.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 (29 lines) | stat: -rw-r--r-- 1,125 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
Before:
  call ale#test#SetDirectory('/testplugin/test/handler')
  cd ..

  runtime ale_linters/ruby/packwerk.vim

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

Execute(The packwerk handler should parse lines correctly):
  call ale#test#SetFilename('test-files/ruby/valid_rails_app/app/models/thing.rb')

  AssertEqual
  \ [
  \     {
  \         'lnum': 36,
  \         'col': 100,
  \         'text': 'Dependency violation: ::Edi::Source belongs to ''edi'', but ''billing'' does not specify a dependency on ''edi''.',
  \     }
  \ ],
  \ ale_linters#ruby#packwerk#Handle(bufnr(''), [
  \   '/Users/JaneDoe/src/github.com/sample-project/billing/app/jobs/document_processing_job.rb:36:100',
  \   'Dependency violation: ::Edi::Source belongs to ''edi'', but ''billing'' does not specify a dependency on ''edi''.',
  \   'Are we missing an abstraction?',
  \   'Is the code making the reference, and the referenced constant, in the right packages?',
  \   '',
  \   'Inference details: ''Edi::Source'' refers to ::Edi::Source which seems to be defined in edi/app/models/edi/source.rb.',
  \ ])