summaryrefslogtreecommitdiff
path: root/test/handler/test_packwerk_handler.vader
diff options
context:
space:
mode:
authorymap <ymap.dev@gmail.com>2023-09-13 23:53:24 +0900
committerGitHub <noreply@github.com>2023-09-13 15:53:24 +0100
commit9092af9ad6a5c93a759be571323ea1d0cafa8d6e (patch)
tree6c58290794d91819fb2d80d2da8752997627537b /test/handler/test_packwerk_handler.vader
parentac615e7f656fb379cfe7cd205842b0f089a060d6 (diff)
downloadale-9092af9ad6a5c93a759be571323ea1d0cafa8d6e.zip
Add support for Packwerk (#4594)
Packwerk (https://github.com/Shopify/packwerk) is a Ruby gem used to enforce boundaries and modularize Rails applications.
Diffstat (limited to 'test/handler/test_packwerk_handler.vader')
-rw-r--r--test/handler/test_packwerk_handler.vader29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/handler/test_packwerk_handler.vader b/test/handler/test_packwerk_handler.vader
new file mode 100644
index 00000000..b95b7556
--- /dev/null
+++ b/test/handler/test_packwerk_handler.vader
@@ -0,0 +1,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.',
+ \ ])