]> git.madduck.net Git - etc/vim.git/blobdiff - .vim/bundle/ale/test/test_tmpdir_wrapper.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '76265755a1add77121c8f9dabb3e9bb70fe9a972' as '.vim/bundle/ale'
[etc/vim.git] / .vim / bundle / ale / test / test_tmpdir_wrapper.vader
diff --git a/.vim/bundle/ale/test/test_tmpdir_wrapper.vader b/.vim/bundle/ale/test/test_tmpdir_wrapper.vader
new file mode 100644 (file)
index 0000000..906f8b7
--- /dev/null
@@ -0,0 +1,32 @@
+Before:
+  let g:exists = exists('$TMPDIR')
+  let g:old_value = $TMPDIR
+
+After:
+  if g:exists
+    let $TMPDIR = g:old_value
+  else
+    silent! unlet! $TMPDIR
+  endif
+
+  unlet! g:exists
+  unlet! g:old_value
+
+Execute(ale#util#Tempname shouldn't set $TMPDIR to an empty string if it isn't set):
+  " You can't run this test twice on old Vim versions.
+  if has('unix')
+    Assert ale#util#Tempname() =~# '^/tmp'
+    Assert !exists('$TMPDIR'), '$TMPDIR exists where it shouldn''t'
+  endif
+
+Execute(ale#util#Tempname shouldn't replace $TMPDIR and reset them to an empty string):
+  if has('unix')
+    let $TMPDIR = ''
+    Assert ale#util#Tempname() =~# '^/tmp'
+
+    if !has('nvim')
+      Assert exists('$TMPDIR'), '$TMPDIR doesn''t exist where it should'
+    endif
+
+    AssertEqual '', $TMPDIR
+  endif