summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThibault Vatter <thibault.vatter@gmail.com>2019-04-23 14:44:26 -0400
committerw0rp <w0rp@users.noreply.github.com>2019-04-23 19:44:26 +0100
commitce0b14979ea7429f07b6ca496333f72d93a8d013 (patch)
tree337a94162284dac87f87e155a27e5837ec3435ea /test
parent893ac34cca903df14dabee7bdee7a018675c16d4 (diff)
downloadale-ce0b14979ea7429f07b6ca496333f72d93a8d013.zip
Add a fixer for r based on the styler package (#2401)
* Add styler as a new fixer for R files * Add to the list of supported tools * Add documentation
Diffstat (limited to 'test')
-rw-r--r--test/fixers/test_styler_fixer_callback.vader21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/fixers/test_styler_fixer_callback.vader b/test/fixers/test_styler_fixer_callback.vader
new file mode 100644
index 00000000..85e45c1d
--- /dev/null
+++ b/test/fixers/test_styler_fixer_callback.vader
@@ -0,0 +1,21 @@
+Before:
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The styler callback should include custom styler options):
+ let g:ale_r_styler_options = "a_custom_option"
+
+ AssertEqual
+ \ {
+ \ 'command': 'Rscript --vanilla -e '
+ \ . '"suppressPackageStartupMessages(library(styler));'
+ \ . 'style_file(commandArgs(TRUE), style = '
+ \ . 'a_custom_option)"'
+ \ . ' %t',
+ \ 'read_temporary_file': 1,
+ \ },
+ \ ale#fixers#styler#Fix(bufnr(''))