/ test / handler / test_packwerk_handler.vader
test_packwerk_handler.vader
 1  Before:
 2    call ale#test#SetDirectory('/testplugin/test/handler')
 3    cd ..
 4  
 5    runtime ale_linters/ruby/packwerk.vim
 6  
 7  After:
 8    call ale#test#RestoreDirectory()
 9    call ale#linter#Reset()
10  
11  Execute(The packwerk handler should parse lines correctly):
12    call ale#test#SetFilename('test-files/ruby/valid_rails_app/app/models/thing.rb')
13  
14    AssertEqual
15    \ [
16    \     {
17    \         'lnum': 36,
18    \         'col': 100,
19    \         'text': 'Dependency violation: ::Edi::Source belongs to ''edi'', but ''billing'' does not specify a dependency on ''edi''.',
20    \     }
21    \ ],
22    \ ale_linters#ruby#packwerk#Handle(bufnr(''), [
23    \   '/Users/JaneDoe/src/github.com/sample-project/billing/app/jobs/document_processing_job.rb:36:100',
24    \   'Dependency violation: ::Edi::Source belongs to ''edi'', but ''billing'' does not specify a dependency on ''edi''.',
25    \   'Are we missing an abstraction?',
26    \   'Is the code making the reference, and the referenced constant, in the right packages?',
27    \   '',
28    \   'Inference details: ''Edi::Source'' refers to ::Edi::Source which seems to be defined in edi/app/models/edi/source.rb.',
29    \ ])