diff options
author | George Roman <george.roman.99@gmail.com> | 2018-06-18 18:57:47 +0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-06-21 23:33:00 -0300 |
commit | bdfe731a601f3d12ffafbf504c9b06d70d5aa819 (patch) | |
tree | b6b94d398ba01fb9345d05b55c0bf2a93801cb2a /spec/install_spec.lua | |
parent | 48ae1d2e7705af6a7527ca61710fe18ccdb7d0b9 (diff) | |
download | luarocks-bdfe731a601f3d12ffafbf504c9b06d70d5aa819.tar.gz luarocks-bdfe731a601f3d12ffafbf504c9b06d70d5aa819.tar.bz2 luarocks-bdfe731a601f3d12ffafbf504c9b06d70d5aa819.zip |
Tests: replace small fixture files with inline content
Diffstat (limited to 'spec/install_spec.lua')
-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() |