aboutsummaryrefslogtreecommitdiff
path: root/spec/install_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/install_spec.lua')
-rw-r--r--spec/install_spec.lua22
1 files changed, 10 insertions, 12 deletions
diff --git a/spec/install_spec.lua b/spec/install_spec.lua
index 306bbbc1..0e406e22 100644
--- a/spec/install_spec.lua
+++ b/spec/install_spec.lua
@@ -1,8 +1,10 @@
1local test_env = require("test/test_environment") 1local test_env = require("test/test_environment")
2local lfs = require("lfs") 2local lfs = require("lfs")
3local run = test_env.run
4local testing_paths = test_env.testing_paths
5local env_variables = test_env.env_variables
3 6
4test_env.unload_luarocks() 7test_env.unload_luarocks()
5local install = require("luarocks.install")
6 8
7local extra_rocks = { 9local extra_rocks = {
8 "/cprint-0.1-2.src.rock", 10 "/cprint-0.1-2.src.rock",
@@ -19,14 +21,10 @@ local extra_rocks = {
19 "/wsapi-1.6-1.src.rock" 21 "/wsapi-1.6-1.src.rock"
20} 22}
21 23
22expose("LuaRocks install tests #blackbox #b_install", function() 24describe("LuaRocks install tests #blackbox #b_install", function()
23 25
24 before_each(function() 26 before_each(function()
25 test_env.setup_specs(extra_rocks) 27 test_env.setup_specs(extra_rocks)
26 testing_paths = test_env.testing_paths
27 env_variables = test_env.env_variables
28 run = test_env.run
29 platform = test_env.platform
30 end) 28 end)
31 29
32 describe("LuaRocks install - basic tests", function() 30 describe("LuaRocks install - basic tests", function()
@@ -86,21 +84,21 @@ expose("LuaRocks install tests #blackbox #b_install", function()
86 84
87 it("LuaRocks install only-deps of luasocket packed rock", function() 85 it("LuaRocks install only-deps of luasocket packed rock", function()
88 assert.is_true(test_env.need_luasocket()) 86 assert.is_true(test_env.need_luasocket())
89 local output = run.luarocks("install --only-deps " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. platform .. ".rock") 87 local output = run.luarocks("install --only-deps " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. test_env.platform .. ".rock")
90 assert.are.same(output, "Successfully installed dependencies for luasocket 3.0rc1-1") 88 assert.are.same(output, "Successfully installed dependencies for luasocket 3.0rc1-1")
91 end) 89 end)
92 90
93 it("LuaRocks install binary rock of cprint", function() 91 it("LuaRocks install binary rock of cprint", function()
94 assert.is_true(test_env.need_luasocket()) 92 assert.is_true(test_env.need_luasocket())
95 assert.is_true(run.luarocks_bool("build --pack-binary-rock cprint")) 93 assert.is_true(run.luarocks_bool("build --pack-binary-rock cprint"))
96 assert.is_true(run.luarocks_bool("install cprint-0.1-2." .. platform .. ".rock")) 94 assert.is_true(run.luarocks_bool("install cprint-0.1-2." .. test_env.platform .. ".rock"))
97 assert.is_true(os.remove("cprint-0.1-2." .. platform .. ".rock")) 95 assert.is_true(os.remove("cprint-0.1-2." .. test_env.platform .. ".rock"))
98 end) 96 end)
99 97
100 it("LuaRocks install reinstall", function() 98 it("LuaRocks install reinstall", function()
101 assert.is_true(test_env.need_luasocket()) 99 assert.is_true(test_env.need_luasocket())
102 assert.is_true(run.luarocks_bool("install " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. platform .. ".rock")) 100 assert.is_true(run.luarocks_bool("install " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. test_env.platform .. ".rock"))
103 assert.is_true(run.luarocks_bool("install --deps-mode=none " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. platform .. ".rock")) 101 assert.is_true(run.luarocks_bool("install --deps-mode=none " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. test_env.platform .. ".rock"))
104 end) 102 end)
105 end) 103 end)
106 104
@@ -127,4 +125,4 @@ expose("LuaRocks install tests #blackbox #b_install", function()
127 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/say/1.0-1")) 125 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/say/1.0-1"))
128 end) 126 end)
129 end) 127 end)
130end) \ No newline at end of file 128end)