mirror of
https://github.com/dense-analysis/ale
synced 2024-12-25 07:32:24 +00:00
chore: Add Elixir Credo tests
This commit is contained in:
parent
433b23be17
commit
7d8275daf5
33
test/test_elixir_credo.vader
Normal file
33
test/test_elixir_credo.vader
Normal file
@ -0,0 +1,33 @@
|
||||
Before:
|
||||
call ale#test#SetDirectory('/testplugin/test')
|
||||
|
||||
runtime ale_linters/elixir/credo.vim
|
||||
|
||||
After:
|
||||
call ale#test#RestoreDirectory()
|
||||
call ale#linter#Reset()
|
||||
let g:ale_elixir_credo_strict = 0
|
||||
let g:ale_elixir_credo_config_file = ''
|
||||
|
||||
Execute(credo runs the right command):
|
||||
call ale#test#SetFilename('elixir-test-files/testfile.ex')
|
||||
|
||||
AssertEqual
|
||||
\ ale_linters#elixir#credo#GetCommand(bufnr('')),
|
||||
\ 'cd ''.'' && mix help credo && mix credo suggest --format=flycheck --read-from-stdin %s'
|
||||
|
||||
Execute(credo runs the right command with the strict flag):
|
||||
let g:ale_elixir_credo_strict = 1
|
||||
call ale#test#SetFilename('elixir-test-files/testfile.ex')
|
||||
|
||||
AssertEqual
|
||||
\ ale_linters#elixir#credo#GetCommand(bufnr('')),
|
||||
\ 'cd ''.'' && mix help credo && mix credo --strict --format=flycheck --read-from-stdin %s'
|
||||
|
||||
Execute(credo runs the right command with a custom config file):
|
||||
let g:ale_elixir_credo_config_file = '/home/user/custom_credo.exs'
|
||||
call ale#test#SetFilename('elixir-test-files/testfile.ex')
|
||||
|
||||
AssertEqual
|
||||
\ ale_linters#elixir#credo#GetCommand(bufnr('')),
|
||||
\ 'cd ''.'' && mix help credo && mix credo suggest --config-file /home/user/custom_credo.exs --format=flycheck --read-from-stdin %s'
|
Loading…
Reference in New Issue
Block a user