summaryrefslogtreecommitdiff
path: root/test/test_format_temporary_file_creation.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-02-11 18:14:18 +0000
committerw0rp <devw0rp@gmail.com>2017-02-11 18:14:18 +0000
commit03ab963d1a02b0f4d45fb10915efa9fd9c5deaf7 (patch)
tree8d3f183a8e170328bc06243e015436bddfb4d697 /test/test_format_temporary_file_creation.vader
parent88192e8662585f809bd248c1d689638ab007ac7b (diff)
downloadale-03ab963d1a02b0f4d45fb10915efa9fd9c5deaf7.zip
Add support for temporary filename substitution, for replacing stdin_wrapper
Diffstat (limited to 'test/test_format_temporary_file_creation.vader')
-rw-r--r--test/test_format_temporary_file_creation.vader33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/test_format_temporary_file_creation.vader b/test/test_format_temporary_file_creation.vader
new file mode 100644
index 00000000..fa20338c
--- /dev/null
+++ b/test/test_format_temporary_file_creation.vader
@@ -0,0 +1,33 @@
+Before:
+ let g:output = []
+
+ function! TestCallback(buffer, output)
+ let g:output = a:output
+
+ return []
+ endfunction
+
+ call ale#linter#Define('foobar', {
+ \ 'name': 'testlinter',
+ \ 'callback': 'TestCallback',
+ \ 'executable': 'cat',
+ \ 'command': 'cat %t',
+ \})
+
+After:
+ unlet! g:output
+ delfunction TestCallback
+ call ale#linter#Reset()
+
+Given foobar (Some imaginary filetype):
+ foo
+ bar
+ baz
+
+Execute(ALE should be able to read the %t file):
+ AssertEqual 'foobar', &filetype
+
+ call ale#Lint()
+ call ale#engine#WaitForJobs(2000)
+
+ AssertEqual ['foo', 'bar', 'baz'], g:output