summaryrefslogtreecommitdiff
path: root/test/test_nearest_file_search.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2016-10-17 21:14:34 +0100
committerw0rp <devw0rp@gmail.com>2016-10-17 21:14:34 +0100
commit654a1724730e181c80cd262a781055c5a9f0ca05 (patch)
tree851119a3a64c9ae82cd95b3725f914c7271ec702 /test/test_nearest_file_search.vader
parent7c2a16e149a0dbcdfcac6ee441474caaad1ef3b6 (diff)
downloadale-654a1724730e181c80cd262a781055c5a9f0ca05.zip
Make the nearest file search result absolute paths, and add tests to cover it.
Diffstat (limited to 'test/test_nearest_file_search.vader')
-rw-r--r--test/test_nearest_file_search.vader11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_nearest_file_search.vader b/test/test_nearest_file_search.vader
new file mode 100644
index 00000000..c59bfce2
--- /dev/null
+++ b/test/test_nearest_file_search.vader
@@ -0,0 +1,11 @@
+Execute(Open a file some directory down):
+ silent! cd /testplugin/test
+ :e! top/middle/bottom/dummy.txt
+
+Then(We should be able to find a configuration file further up):
+ AssertEqual expand('%:p:h:h:h:h') . '/top/example.ini', ale#util#FindNearestFile(bufnr('%'), 'example.ini')
+
+Execute(Do nothing):
+
+Then(We shouldn't find anything for files which don't match):
+ AssertEqual '', ale#util#FindNearestFile(bufnr('%'), 'cantfindthis')