diff options
Diffstat (limited to '')
-rw-r--r-- | spec/install_spec.lua | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/spec/install_spec.lua b/spec/install_spec.lua index 3525cda3..f18b7c89 100644 --- a/spec/install_spec.lua +++ b/spec/install_spec.lua | |||
@@ -3,6 +3,8 @@ local lfs = require("lfs") | |||
3 | local run = test_env.run | 3 | local run = test_env.run |
4 | local testing_paths = test_env.testing_paths | 4 | local testing_paths = test_env.testing_paths |
5 | local env_variables = test_env.env_variables | 5 | local env_variables = test_env.env_variables |
6 | local get_tmp_path = test_env.get_tmp_path | ||
7 | local write_file = test_env.write_file | ||
6 | 8 | ||
7 | test_env.unload_luarocks() | 9 | test_env.unload_luarocks() |
8 | 10 | ||
@@ -55,7 +57,18 @@ describe("luarocks install #integration", function() | |||
55 | end) | 57 | end) |
56 | 58 | ||
57 | it("fails not a zip file", function() | 59 | it("fails not a zip file", function() |
58 | assert.is_false(run.luarocks_bool("install " .. testing_paths.fixtures_dir .. "/not_a_zipfile-1.0-1.src.rock")) | 60 | local olddir = lfs.currentdir() |
61 | local tmpdir = get_tmp_path() | ||
62 | lfs.mkdir(tmpdir) | ||
63 | lfs.chdir(tmpdir) | ||
64 | |||
65 | write_file("not_a_zipfile-1.0-1.src.rock", [[ | ||
66 | I am not a .zip file! | ||
67 | ]], finally) | ||
68 | assert.is_false(run.luarocks_bool("install not_a_zipfile-1.0-1.src.rock")) | ||
69 | |||
70 | lfs.chdir(olddir) | ||
71 | lfs.rmdir(tmpdir) | ||
59 | end) | 72 | end) |
60 | 73 | ||
61 | it("only-deps of lxsh show there is no lxsh", function() | 74 | it("only-deps of lxsh show there is no lxsh", function() |