aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/assert_spec.lua
diff options
context:
space:
mode:
authorwatiko <service@mail.watiko.net>2015-12-19 10:25:19 +0900
committerwatiko <service@mail.watiko.net>2016-01-10 10:44:57 +0900
commitfeed81f45f1c9fa52e54f4a6168391dac6200066 (patch)
tree0f8282087f185e7c8567a64a94b8b4dd432aa2b0 /test/functional/legacy/assert_spec.lua
parentd37dc0b3142c7f4795a28c44d6ebb85b8c961c0c (diff)
downloadrneovim-feed81f45f1c9fa52e54f4a6168391dac6200066.tar.gz
rneovim-feed81f45f1c9fa52e54f4a6168391dac6200066.tar.bz2
rneovim-feed81f45f1c9fa52e54f4a6168391dac6200066.zip
tests: Fix OSX's tempname issue.
Diffstat (limited to 'test/functional/legacy/assert_spec.lua')
-rw-r--r--test/functional/legacy/assert_spec.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/functional/legacy/assert_spec.lua b/test/functional/legacy/assert_spec.lua
index 5d91aa9099..20d78db363 100644
--- a/test/functional/legacy/assert_spec.lua
+++ b/test/functional/legacy/assert_spec.lua
@@ -1,3 +1,4 @@
+local ffi = require('ffi')
local helpers = require('test.functional.helpers')
local nvim, call = helpers.meths, helpers.call
local clear, eq = helpers.clear, helpers.eq
@@ -13,6 +14,11 @@ end
local function source(code)
local tmpname = os.tmpname()
+
+ if ffi.os == 'OSX' and string.match(tmpname, '^/tmp') then
+ tmpname = '/private'..tmpname
+ end
+
write_file(tmpname, code)
nvim.command('source '..tmpname)
os.remove(tmpname)