diff options
author | w0rp <devw0rp@gmail.com> | 2018-07-15 18:24:53 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-07-15 18:28:28 +0100 |
commit | a42999a639b2916b769a85f37d037be314d9d61b (patch) | |
tree | 5ebfb4d357dc673efa93fd32a66b489c4510de40 /test/command_callback/test_reek_command_callback.vader | |
parent | 5155a35a80fe3b20659eb0f28cc6cc720532dd3f (diff) | |
download | ale-a42999a639b2916b769a85f37d037be314d9d61b.zip |
Massively reduce the amount of code needed for linter tests
Diffstat (limited to 'test/command_callback/test_reek_command_callback.vader')
-rw-r--r-- | test/command_callback/test_reek_command_callback.vader | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/test/command_callback/test_reek_command_callback.vader b/test/command_callback/test_reek_command_callback.vader index 41e749c1..059e5e36 100644 --- a/test/command_callback/test_reek_command_callback.vader +++ b/test/command_callback/test_reek_command_callback.vader @@ -1,34 +1,34 @@ Before: - runtime ale_linters/ruby/reek.vim - call ale#test#SetDirectory('/testplugin/test/command_callback') + call ale#assert#SetUpLinterTest('ruby', 'reek') After: - call ale#test#RestoreDirectory() - call ale#linter#Reset() - call ale#semver#ResetVersionCache() + call ale#assert#TearDownLinterTest() Execute(The reek callbacks should return the correct default values): - AssertEqual + WithChainResults ['reek 5.0.0'] + AssertLinter 'reek', [ \ 'reek --version', - \ ale_linters#ruby#reek#VersionCheck(bufnr('')) - AssertEqual \ 'reek -f json --no-progress --no-color --stdin-filename %s', - \ ale_linters#ruby#reek#GetCommand(bufnr(''), ['reek 5.0.0']) + \] " Try with older versions. call ale#semver#ResetVersionCache() - AssertEqual + + WithChainResults ['reek 4.8.2'] + AssertLinter 'reek', [ + \ 'reek --version', \ 'reek -f json --no-progress --no-color', - \ ale_linters#ruby#reek#GetCommand(bufnr(''), ['reek 4.8.2']) + \] Execute(The reek version check should be cached): - AssertEqual + WithChainResults ['reek 5.0.0'] + AssertLinter 'reek', [ + \ 'reek --version', \ 'reek -f json --no-progress --no-color --stdin-filename %s', - \ ale_linters#ruby#reek#GetCommand(bufnr(''), ['reek 5.0.0']) + \] - AssertEqual + WithChainResults [] + AssertLinter 'reek', [ \ '', - \ ale_linters#ruby#reek#VersionCheck(bufnr('')) - AssertEqual \ 'reek -f json --no-progress --no-color --stdin-filename %s', - \ ale_linters#ruby#reek#GetCommand(bufnr(''), []) + \] |