aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Roman <george.roman.99@gmail.com>2018-05-29 12:28:08 +0300
committerHisham Muhammad <hisham@gobolinux.org>2018-05-29 09:22:03 -0300
commitd28b6669bdc28318bed47d37cfa6968a07654a23 (patch)
tree212f188056010449bd9cd4c8b947fe3f67a100ba
parenta5305f659c159173002b0a2d393021dadc25fc8f (diff)
downloadluarocks-d28b6669bdc28318bed47d37cfa6968a07654a23.tar.gz
luarocks-d28b6669bdc28318bed47d37cfa6968a07654a23.tar.bz2
luarocks-d28b6669bdc28318bed47d37cfa6968a07654a23.zip
Update fs_spec to use test_env temporary path utility
-rw-r--r--spec/fs_spec.lua10
1 files changed, 1 insertions, 9 deletions
diff --git a/spec/fs_spec.lua b/spec/fs_spec.lua
index 29176af5..b250e321 100644
--- a/spec/fs_spec.lua
+++ b/spec/fs_spec.lua
@@ -6,17 +6,9 @@ local lfs = require("lfs")
6local is_win = test_env.TEST_TARGET_OS == "windows" 6local is_win = test_env.TEST_TARGET_OS == "windows"
7local posix_ok = pcall(require, "posix") 7local posix_ok = pcall(require, "posix")
8local testing_paths = test_env.testing_paths 8local testing_paths = test_env.testing_paths
9local get_tmp_path = test_env.get_tmp_path
9 10
10describe("Luarocks fs test #whitebox #w_fs", function() 11describe("Luarocks fs test #whitebox #w_fs", function()
11 local get_tmp_path = function()
12 local path = os.tmpname()
13 if is_win and not path:find(":") then
14 path = os.getenv("TEMP") .. path
15 end
16 os.remove(path)
17 return path
18 end
19
20 local exists_file = function(path) 12 local exists_file = function(path)
21 local ok, err, code = os.rename(path, path) 13 local ok, err, code = os.rename(path, path)
22 if not ok and code == 13 then 14 if not ok and code == 13 then