diff options
author | Peter Melnichenko <mpeterval@gmail.com> | 2016-07-09 16:35:33 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-09 16:35:33 +0400 |
commit | 8e55688c191827a9b2e9c499a95c888078979e8c (patch) | |
tree | aeaf8c1886c949e8e357b59a04cebc3be3930bce /spec/install_spec.lua | |
parent | 5af7e0d7c2dcf65e41ae8523f3771e9528be32a7 (diff) | |
parent | a05ba7ce42ae4e42f80b5cacdd8770ae5e6cc04b (diff) | |
download | luarocks-8e55688c191827a9b2e9c499a95c888078979e8c.tar.gz luarocks-8e55688c191827a9b2e9c499a95c888078979e8c.tar.bz2 luarocks-8e55688c191827a9b2e9c499a95c888078979e8c.zip |
Merge pull request #583 from mpeterv/adjust-new-tests
Minor changes and fixes for new test suite
Diffstat (limited to 'spec/install_spec.lua')
-rw-r--r-- | spec/install_spec.lua | 22 |
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 @@ | |||
1 | local test_env = require("test/test_environment") | 1 | local test_env = require("test/test_environment") |
2 | local lfs = require("lfs") | 2 | local lfs = require("lfs") |
3 | local run = test_env.run | ||
4 | local testing_paths = test_env.testing_paths | ||
5 | local env_variables = test_env.env_variables | ||
3 | 6 | ||
4 | test_env.unload_luarocks() | 7 | test_env.unload_luarocks() |
5 | local install = require("luarocks.install") | ||
6 | 8 | ||
7 | local extra_rocks = { | 9 | local 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 | ||
22 | expose("LuaRocks install tests #blackbox #b_install", function() | 24 | describe("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) |
130 | end) \ No newline at end of file | 128 | end) |