diff options
author | w0rp <devw0rp@gmail.com> | 2017-09-03 23:29:12 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-09-03 23:29:12 +0100 |
commit | 1ea5400e8d26c1ebb99912cace5faaffa8c270bf (patch) | |
tree | 289bd96d04ba7d9b324fa0a8389af6df909d4c34 /test/command_callback/test_lintr_command_callback.vader | |
parent | b60a7224ab8165280d61314016003181fb45fc4d (diff) | |
download | ale-1ea5400e8d26c1ebb99912cace5faaffa8c270bf.zip |
Test lintr options configuration
Diffstat (limited to 'test/command_callback/test_lintr_command_callback.vader')
-rw-r--r-- | test/command_callback/test_lintr_command_callback.vader | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/command_callback/test_lintr_command_callback.vader b/test/command_callback/test_lintr_command_callback.vader new file mode 100644 index 00000000..3199b498 --- /dev/null +++ b/test/command_callback/test_lintr_command_callback.vader @@ -0,0 +1,34 @@ +Before: + Save g:ale_r_lintr_options + + unlet! g:ale_r_lintr_options + unlet! b:ale_r_lintr_options + + runtime ale_linters/r/lintr.vim + +After: + Restore + + unlet! b:ale_r_lintr_options + + call ale#linter#Reset() + +Execute(The default lintr command should be correct): + AssertEqual + \ 'cd ' . ale#Escape(getcwd()) . ' && ' + \ . 'Rscript -e ' + \ . ale#Escape('lintr::lint(commandArgs(TRUE)[1], eval(parse(text = commandArgs(TRUE)[2])))') + \ . ' %t ' + \ . ale#Escape('lintr::with_defaults()'), + \ ale_linters#r#lintr#GetCommand(bufnr('')) + +Execute(The lintr options should be configurable): + let b:ale_r_lintr_options = 'lintr::with_defaults(object_usage_linter = NULL)' + + AssertEqual + \ 'cd ' . ale#Escape(getcwd()) . ' && ' + \ . 'Rscript -e ' + \ . ale#Escape('lintr::lint(commandArgs(TRUE)[1], eval(parse(text = commandArgs(TRUE)[2])))') + \ . ' %t ' + \ . ale#Escape('lintr::with_defaults(object_usage_linter = NULL)'), + \ ale_linters#r#lintr#GetCommand(bufnr('')) |