summaryrefslogtreecommitdiff
path: root/test/command_callback
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-07-01 10:21:59 +0100
committerw0rp <devw0rp@gmail.com>2018-07-01 10:21:59 +0100
commitb88bf6ecba5d037c12cf6a94afcb70787a932704 (patch)
tree86199322df8f8d25b188a23aae65e4d9e20a93a5 /test/command_callback
parentee81351a6393a6fef1b3556aebfdf522421018f3 (diff)
downloadale-b88bf6ecba5d037c12cf6a94afcb70787a932704.zip
Fix #1412 - Use --stdin-filename for newer reek versions
Diffstat (limited to 'test/command_callback')
-rw-r--r--test/command_callback/test_reek_command_callback.vader34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/command_callback/test_reek_command_callback.vader b/test/command_callback/test_reek_command_callback.vader
new file mode 100644
index 00000000..41e749c1
--- /dev/null
+++ b/test/command_callback/test_reek_command_callback.vader
@@ -0,0 +1,34 @@
+Before:
+ runtime ale_linters/ruby/reek.vim
+ call ale#test#SetDirectory('/testplugin/test/command_callback')
+
+After:
+ call ale#test#RestoreDirectory()
+ call ale#linter#Reset()
+ call ale#semver#ResetVersionCache()
+
+Execute(The reek callbacks should return the correct default values):
+ AssertEqual
+ \ '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
+ \ '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
+ \ 'reek -f json --no-progress --no-color --stdin-filename %s',
+ \ ale_linters#ruby#reek#GetCommand(bufnr(''), ['reek 5.0.0'])
+
+ AssertEqual
+ \ '',
+ \ ale_linters#ruby#reek#VersionCheck(bufnr(''))
+ AssertEqual
+ \ 'reek -f json --no-progress --no-color --stdin-filename %s',
+ \ ale_linters#ruby#reek#GetCommand(bufnr(''), [])