diff options
-rw-r--r-- | spec/fs_spec.lua | 10 |
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") | |||
6 | local is_win = test_env.TEST_TARGET_OS == "windows" | 6 | local is_win = test_env.TEST_TARGET_OS == "windows" |
7 | local posix_ok = pcall(require, "posix") | 7 | local posix_ok = pcall(require, "posix") |
8 | local testing_paths = test_env.testing_paths | 8 | local testing_paths = test_env.testing_paths |
9 | local get_tmp_path = test_env.get_tmp_path | ||
9 | 10 | ||
10 | describe("Luarocks fs test #whitebox #w_fs", function() | 11 | describe("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 |