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 | |
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')
-rw-r--r-- | spec/add_spec.lua | 10 | ||||
-rw-r--r-- | spec/build_spec.lua | 7 | ||||
-rw-r--r-- | spec/config_spec.lua | 12 | ||||
-rw-r--r-- | spec/deps_spec.lua | 9 | ||||
-rw-r--r-- | spec/doc_spec.lua | 7 | ||||
-rw-r--r-- | spec/download_spec.lua | 5 | ||||
-rw-r--r-- | spec/fetch_spec.lua | 3 | ||||
-rw-r--r-- | spec/help_spec.lua | 10 | ||||
-rw-r--r-- | spec/install_spec.lua | 22 | ||||
-rw-r--r-- | spec/lint_spec.lua | 10 | ||||
-rw-r--r-- | spec/list_spec.lua | 8 | ||||
-rw-r--r-- | spec/make_manifest_spec.lua | 10 | ||||
-rw-r--r-- | spec/make_spec.lua | 9 | ||||
-rw-r--r-- | spec/new_version_spec.lua | 9 | ||||
-rw-r--r-- | spec/pack_spec.lua | 6 | ||||
-rw-r--r-- | spec/path_spec.lua | 8 | ||||
-rw-r--r-- | spec/purge_spec.lua | 10 | ||||
-rw-r--r-- | spec/refresh_cache_spec.lua | 10 | ||||
-rw-r--r-- | spec/remove_spec.lua | 9 | ||||
-rw-r--r-- | spec/search_spec.lua | 8 | ||||
-rw-r--r-- | spec/show_spec.lua | 8 | ||||
-rw-r--r-- | spec/unpack_spec.lua | 13 | ||||
-rw-r--r-- | spec/upload_spec.lua | 6 | ||||
-rw-r--r-- | spec/util_spec.lua | 10 | ||||
-rw-r--r-- | spec/write_rockspec_spec.lua | 9 |
25 files changed, 94 insertions, 134 deletions
diff --git a/spec/add_spec.lua b/spec/add_spec.lua index e417f974..dca6f850 100644 --- a/spec/add_spec.lua +++ b/spec/add_spec.lua | |||
@@ -1,20 +1,18 @@ | |||
1 | local test_env = require("test/test_environment") | 1 | local test_env = require("test/test_environment") |
2 | local lfs = require("lfs") | 2 | local run = test_env.run |
3 | local testing_paths = test_env.testing_paths | ||
3 | 4 | ||
4 | test_env.unload_luarocks() | 5 | test_env.unload_luarocks() |
5 | local add = require("luarocks.add") | ||
6 | 6 | ||
7 | local extra_rocks = { | 7 | local extra_rocks = { |
8 | "/luasocket-3.0rc1-1.src.rock", | 8 | "/luasocket-3.0rc1-1.src.rock", |
9 | "/luasocket-3.0rc1-1.rockspec" | 9 | "/luasocket-3.0rc1-1.rockspec" |
10 | } | 10 | } |
11 | 11 | ||
12 | expose("LuaRocks add tests #blackbox #b_add", function() | 12 | describe("LuaRocks add tests #blackbox #b_add", function() |
13 | 13 | ||
14 | before_each(function() | 14 | before_each(function() |
15 | test_env.setup_specs(extra_rocks) | 15 | test_env.setup_specs(extra_rocks) |
16 | testing_paths = test_env.testing_paths | ||
17 | run = test_env.run | ||
18 | end) | 16 | end) |
19 | 17 | ||
20 | describe("LuaRocks-admin add tests", function() | 18 | describe("LuaRocks-admin add tests", function() |
@@ -43,4 +41,4 @@ expose("LuaRocks add tests #blackbox #b_add", function() | |||
43 | assert.is_false(run.luarocks_admin_bool("--server=\"localhost@/tmp/luarocks_testing\" add " .. testing_paths.testing_server .. "luasocket-3.0rc1-1.src.rock")) | 41 | assert.is_false(run.luarocks_admin_bool("--server=\"localhost@/tmp/luarocks_testing\" add " .. testing_paths.testing_server .. "luasocket-3.0rc1-1.src.rock")) |
44 | end) | 42 | end) |
45 | end) | 43 | end) |
46 | end) \ No newline at end of file | 44 | end) |
diff --git a/spec/build_spec.lua b/spec/build_spec.lua index 6665de0b..1ce99089 100644 --- a/spec/build_spec.lua +++ b/spec/build_spec.lua | |||
@@ -1,8 +1,9 @@ | |||
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 | ||
3 | 5 | ||
4 | test_env.unload_luarocks() | 6 | test_env.unload_luarocks() |
5 | local build = require("luarocks.build") | ||
6 | 7 | ||
7 | local extra_rocks = { | 8 | local extra_rocks = { |
8 | "/lmathx-20120430.51-1.src.rock", | 9 | "/lmathx-20120430.51-1.src.rock", |
@@ -26,12 +27,10 @@ local extra_rocks = { | |||
26 | "/validate-args-1.5.4-1.rockspec" | 27 | "/validate-args-1.5.4-1.rockspec" |
27 | } | 28 | } |
28 | 29 | ||
29 | expose("LuaRocks build tests #blackbox #b_build", function() | 30 | describe("LuaRocks build tests #blackbox #b_build", function() |
30 | 31 | ||
31 | before_each(function() | 32 | before_each(function() |
32 | test_env.setup_specs(extra_rocks) | 33 | test_env.setup_specs(extra_rocks) |
33 | testing_paths = test_env.testing_paths | ||
34 | run = test_env.run | ||
35 | end) | 34 | end) |
36 | 35 | ||
37 | describe("LuaRocks build - basic testing set", function() | 36 | describe("LuaRocks build - basic testing set", function() |
diff --git a/spec/config_spec.lua b/spec/config_spec.lua index f6cabd8c..0dee8620 100644 --- a/spec/config_spec.lua +++ b/spec/config_spec.lua | |||
@@ -1,17 +1,17 @@ | |||
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 site_config | ||
3 | 6 | ||
4 | test_env.unload_luarocks() | 7 | test_env.unload_luarocks() |
5 | local cfg = require("luarocks.cfg") | ||
6 | 8 | ||
7 | expose("LuaRocks config tests #blackbox #b_config", function() | 9 | describe("LuaRocks config tests #blackbox #b_config", function() |
8 | 10 | ||
9 | before_each(function() | 11 | before_each(function() |
10 | test_env.setup_specs(extra_rocks) | 12 | test_env.setup_specs() |
11 | test_env.unload_luarocks() -- need to be required here, because site_config is created after first loading of specs | 13 | test_env.unload_luarocks() -- need to be required here, because site_config is created after first loading of specs |
12 | site_config = require("luarocks.site_config") | 14 | site_config = require("luarocks.site_config") |
13 | testing_paths = test_env.testing_paths | ||
14 | run = test_env.run | ||
15 | end) | 15 | end) |
16 | 16 | ||
17 | describe("LuaRocks config - basic tests", function() | 17 | describe("LuaRocks config - basic tests", function() |
@@ -87,4 +87,4 @@ expose("LuaRocks config tests #blackbox #b_config", function() | |||
87 | test_env.remove_dir(testing_paths.testing_lrprefix) | 87 | test_env.remove_dir(testing_paths.testing_lrprefix) |
88 | end) | 88 | end) |
89 | end) | 89 | end) |
90 | end) \ No newline at end of file | 90 | end) |
diff --git a/spec/deps_spec.lua b/spec/deps_spec.lua index ce784080..c1bd404d 100644 --- a/spec/deps_spec.lua +++ b/spec/deps_spec.lua | |||
@@ -1,8 +1,9 @@ | |||
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 | ||
3 | 5 | ||
4 | test_env.unload_luarocks() | 6 | test_env.unload_luarocks() |
5 | local deps = require("luarocks.deps") | ||
6 | 7 | ||
7 | local extra_rocks = { | 8 | local extra_rocks = { |
8 | "/lxsh-0.8.6-2.src.rock", | 9 | "/lxsh-0.8.6-2.src.rock", |
@@ -12,12 +13,10 @@ local extra_rocks = { | |||
12 | "/lpeg-0.12-1.src.rock" | 13 | "/lpeg-0.12-1.src.rock" |
13 | } | 14 | } |
14 | 15 | ||
15 | expose("LuaRocks deps tests #blackbox #b_deps", function() | 16 | describe("LuaRocks deps tests #blackbox #b_deps", function() |
16 | 17 | ||
17 | before_each(function() | 18 | before_each(function() |
18 | test_env.setup_specs(extra_rocks) | 19 | test_env.setup_specs(extra_rocks) |
19 | testing_paths = test_env.testing_paths | ||
20 | run = test_env.run | ||
21 | end) | 20 | end) |
22 | 21 | ||
23 | it("LuaRocks deps mode one", function() | 22 | it("LuaRocks deps mode one", function() |
@@ -112,4 +111,4 @@ expose("LuaRocks deps tests #blackbox #b_deps", function() | |||
112 | assert.is.falsy(lfs.attributes(testing_paths.testing_tree .. "/lib/luarocks/rocks/lxsh")) | 111 | assert.is.falsy(lfs.attributes(testing_paths.testing_tree .. "/lib/luarocks/rocks/lxsh")) |
113 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lxsh")) | 112 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lxsh")) |
114 | end) | 113 | end) |
115 | end) \ No newline at end of file | 114 | end) |
diff --git a/spec/doc_spec.lua b/spec/doc_spec.lua index 476b8ea8..9dbeaab8 100644 --- a/spec/doc_spec.lua +++ b/spec/doc_spec.lua | |||
@@ -1,19 +1,16 @@ | |||
1 | local test_env = require("test/test_environment") | 1 | local test_env = require("test/test_environment") |
2 | local lfs = require("lfs") | 2 | local run = test_env.run |
3 | 3 | ||
4 | test_env.unload_luarocks() | 4 | test_env.unload_luarocks() |
5 | local doc = require("luarocks.doc") | ||
6 | 5 | ||
7 | local extra_rocks = { | 6 | local extra_rocks = { |
8 | "/luarepl-0.4-1.src.rock" | 7 | "/luarepl-0.4-1.src.rock" |
9 | } | 8 | } |
10 | 9 | ||
11 | expose("LuaRocks doc tests #blackbox #b_doc", function() | 10 | describe("LuaRocks doc tests #blackbox #b_doc", function() |
12 | 11 | ||
13 | before_each(function() | 12 | before_each(function() |
14 | test_env.setup_specs(extra_rocks) | 13 | test_env.setup_specs(extra_rocks) |
15 | testing_paths = test_env.testing_paths | ||
16 | run = test_env.run | ||
17 | end) | 14 | end) |
18 | 15 | ||
19 | describe("LuaRocks doc basic tests", function() | 16 | describe("LuaRocks doc basic tests", function() |
diff --git a/spec/download_spec.lua b/spec/download_spec.lua index 9b5d9e2e..320d9304 100644 --- a/spec/download_spec.lua +++ b/spec/download_spec.lua | |||
@@ -1,18 +1,17 @@ | |||
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 | ||
3 | 4 | ||
4 | test_env.unload_luarocks() | 5 | test_env.unload_luarocks() |
5 | local download = require("luarocks.download") | ||
6 | 6 | ||
7 | local extra_rocks = { | 7 | local extra_rocks = { |
8 | "/validate-args-1.5.4-1.rockspec" | 8 | "/validate-args-1.5.4-1.rockspec" |
9 | } | 9 | } |
10 | 10 | ||
11 | expose("LuaRocks download tests #blackbox #b_download", function() | 11 | describe("LuaRocks download tests #blackbox #b_download", function() |
12 | 12 | ||
13 | before_each(function() | 13 | before_each(function() |
14 | test_env.setup_specs(extra_rocks) | 14 | test_env.setup_specs(extra_rocks) |
15 | run = test_env.run | ||
16 | end) | 15 | end) |
17 | 16 | ||
18 | it("LuaRocks download with no flags/arguments", function() | 17 | it("LuaRocks download with no flags/arguments", function() |
diff --git a/spec/fetch_spec.lua b/spec/fetch_spec.lua index 1f298733..05a709e4 100644 --- a/spec/fetch_spec.lua +++ b/spec/fetch_spec.lua | |||
@@ -1,5 +1,4 @@ | |||
1 | local test_env = require("test/test_environment") | 1 | local test_env = require("test/test_environment") |
2 | local lfs = require("lfs") | ||
3 | 2 | ||
4 | test_env.unload_luarocks() | 3 | test_env.unload_luarocks() |
5 | local fetch = require("luarocks.fetch") | 4 | local fetch = require("luarocks.fetch") |
@@ -13,4 +12,4 @@ describe("Luarocks fetch test #whitebox #w_fetch", function() | |||
13 | assert.are.same("parser.moon", fetch.url_to_base_dir("git://github.com/Cirru/parser.moon")) | 12 | assert.are.same("parser.moon", fetch.url_to_base_dir("git://github.com/Cirru/parser.moon")) |
14 | assert.are.same("v0.3", fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2/archive/v0.3")) | 13 | assert.are.same("v0.3", fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2/archive/v0.3")) |
15 | end) | 14 | end) |
16 | end) \ No newline at end of file | 15 | end) |
diff --git a/spec/help_spec.lua b/spec/help_spec.lua index 0f40dd38..0d41e2e9 100644 --- a/spec/help_spec.lua +++ b/spec/help_spec.lua | |||
@@ -1,14 +1,12 @@ | |||
1 | local test_env = require("test/test_environment") | 1 | local test_env = require("test/test_environment") |
2 | local lfs = require("lfs") | 2 | local run = test_env.run |
3 | 3 | ||
4 | test_env.unload_luarocks() | 4 | test_env.unload_luarocks() |
5 | local help = require("luarocks.help") | ||
6 | 5 | ||
7 | expose("LuaRocks help tests #blackbox #b_help", function() | 6 | describe("LuaRocks help tests #blackbox #b_help", function() |
8 | 7 | ||
9 | before_each(function() | 8 | before_each(function() |
10 | test_env.setup_specs(extra_rocks) | 9 | test_env.setup_specs() |
11 | run = test_env.run | ||
12 | end) | 10 | end) |
13 | 11 | ||
14 | it("LuaRocks help with no flags/arguments", function() | 12 | it("LuaRocks help with no flags/arguments", function() |
@@ -26,4 +24,4 @@ expose("LuaRocks help tests #blackbox #b_help", function() | |||
26 | it("LuaRocks-admin help with no flags/arguments", function() | 24 | it("LuaRocks-admin help with no flags/arguments", function() |
27 | assert.is_true(run.luarocks_admin_bool("help")) | 25 | assert.is_true(run.luarocks_admin_bool("help")) |
28 | end) | 26 | end) |
29 | end) \ No newline at end of file | 27 | end) |
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) |
diff --git a/spec/lint_spec.lua b/spec/lint_spec.lua index cba80a3e..f7496037 100644 --- a/spec/lint_spec.lua +++ b/spec/lint_spec.lua | |||
@@ -1,19 +1,17 @@ | |||
1 | local test_env = require("test/test_environment") | 1 | local test_env = require("test/test_environment") |
2 | local lfs = require("lfs") | 2 | local run = test_env.run |
3 | local testing_paths = test_env.testing_paths | ||
3 | 4 | ||
4 | test_env.unload_luarocks() | 5 | test_env.unload_luarocks() |
5 | local lint = require("luarocks.lint") | ||
6 | 6 | ||
7 | local extra_rocks = { | 7 | local extra_rocks = { |
8 | "/validate-args-1.5.4-1.rockspec" | 8 | "/validate-args-1.5.4-1.rockspec" |
9 | } | 9 | } |
10 | 10 | ||
11 | expose("LuaRocks lint tests #blackbox #b_lint", function() | 11 | describe("LuaRocks lint tests #blackbox #b_lint", function() |
12 | 12 | ||
13 | before_each(function() | 13 | before_each(function() |
14 | test_env.setup_specs(extra_rocks) | 14 | test_env.setup_specs(extra_rocks) |
15 | testing_paths = test_env.testing_paths | ||
16 | run = test_env.run | ||
17 | end) | 15 | end) |
18 | 16 | ||
19 | it("LuaRocks lint with no flags/arguments", function() | 17 | it("LuaRocks lint with no flags/arguments", function() |
@@ -48,4 +46,4 @@ expose("LuaRocks lint tests #blackbox #b_lint", function() | |||
48 | assert.is_false(run.luarocks_bool("lint " .. testing_paths.testing_dir .. "/testfiles/no_build_table-1.0-1.rockspec")) | 46 | assert.is_false(run.luarocks_bool("lint " .. testing_paths.testing_dir .. "/testfiles/no_build_table-1.0-1.rockspec")) |
49 | end) | 47 | end) |
50 | end) | 48 | end) |
51 | end) \ No newline at end of file | 49 | end) |
diff --git a/spec/list_spec.lua b/spec/list_spec.lua index 545483df..1b082ab6 100644 --- a/spec/list_spec.lua +++ b/spec/list_spec.lua | |||
@@ -1,20 +1,18 @@ | |||
1 | local test_env = require("test/test_environment") | 1 | local test_env = require("test/test_environment") |
2 | local lfs = require("lfs") | 2 | local run = test_env.run |
3 | local testing_paths = test_env.testing_paths | ||
3 | 4 | ||
4 | test_env.unload_luarocks() | 5 | test_env.unload_luarocks() |
5 | local list = require("luarocks.list") | ||
6 | 6 | ||
7 | local extra_rocks = { | 7 | local extra_rocks = { |
8 | "/say-1.0-1.src.rock", | 8 | "/say-1.0-1.src.rock", |
9 | "/say-1.2-1.src.rock" | 9 | "/say-1.2-1.src.rock" |
10 | } | 10 | } |
11 | 11 | ||
12 | expose("LuaRocks list tests #blackbox #b_list", function() | 12 | describe("LuaRocks list tests #blackbox #b_list", function() |
13 | 13 | ||
14 | before_each(function() | 14 | before_each(function() |
15 | test_env.setup_specs(extra_rocks) | 15 | test_env.setup_specs(extra_rocks) |
16 | run = test_env.run | ||
17 | testing_paths = test_env.testing_paths | ||
18 | end) | 16 | end) |
19 | 17 | ||
20 | it("LuaRocks list with no flags/arguments", function() | 18 | it("LuaRocks list with no flags/arguments", function() |
diff --git a/spec/make_manifest_spec.lua b/spec/make_manifest_spec.lua index c6cb1328..1c7f5bf8 100644 --- a/spec/make_manifest_spec.lua +++ b/spec/make_manifest_spec.lua | |||
@@ -1,14 +1,12 @@ | |||
1 | local test_env = require("test/test_environment") | 1 | local test_env = require("test/test_environment") |
2 | local lfs = require("lfs") | 2 | local run = test_env.run |
3 | 3 | ||
4 | test_env.unload_luarocks() | 4 | test_env.unload_luarocks() |
5 | local make_manifest = require("luarocks.make_manifest") | ||
6 | 5 | ||
7 | expose("LuaRocks make_manifest tests #blackbox #b_make_manifest", function() | 6 | describe("LuaRocks make_manifest tests #blackbox #b_make_manifest", function() |
8 | 7 | ||
9 | before_each(function() | 8 | before_each(function() |
10 | test_env.setup_specs(extra_rocks) | 9 | test_env.setup_specs() |
11 | run = test_env.run | ||
12 | end) | 10 | end) |
13 | 11 | ||
14 | describe("LuaRocks-admin make manifest tests", function() | 12 | describe("LuaRocks-admin make manifest tests", function() |
@@ -16,4 +14,4 @@ expose("LuaRocks make_manifest tests #blackbox #b_make_manifest", function() | |||
16 | assert.is_true(run.luarocks_admin_bool("make_manifest")) | 14 | assert.is_true(run.luarocks_admin_bool("make_manifest")) |
17 | end) | 15 | end) |
18 | end) | 16 | end) |
19 | end) \ No newline at end of file | 17 | end) |
diff --git a/spec/make_spec.lua b/spec/make_spec.lua index f70bb7e9..2821c143 100644 --- a/spec/make_spec.lua +++ b/spec/make_spec.lua | |||
@@ -1,8 +1,9 @@ | |||
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 | ||
3 | 5 | ||
4 | test_env.unload_luarocks() | 6 | test_env.unload_luarocks() |
5 | local make = require("luarocks.make") | ||
6 | 7 | ||
7 | local extra_rocks = { | 8 | local extra_rocks = { |
8 | "/lpeg-0.12-1.src.rock", | 9 | "/lpeg-0.12-1.src.rock", |
@@ -12,12 +13,10 @@ local extra_rocks = { | |||
12 | "/lxsh-0.8.6-2.rockspec" | 13 | "/lxsh-0.8.6-2.rockspec" |
13 | } | 14 | } |
14 | 15 | ||
15 | expose("LuaRocks make tests #blackbox #b_make", function() | 16 | describe("LuaRocks make tests #blackbox #b_make", function() |
16 | 17 | ||
17 | before_each(function() | 18 | before_each(function() |
18 | test_env.setup_specs(extra_rocks) | 19 | test_env.setup_specs(extra_rocks) |
19 | run = test_env.run | ||
20 | testing_paths = test_env.testing_paths | ||
21 | end) | 20 | end) |
22 | 21 | ||
23 | it("LuaRocks make with no flags/arguments", function() | 22 | it("LuaRocks make with no flags/arguments", function() |
@@ -96,4 +95,4 @@ expose("LuaRocks make tests #blackbox #b_make", function() | |||
96 | assert.is.truthy(lfs.attributes("lxsh-0.8.6-2.all.rock")) | 95 | assert.is.truthy(lfs.attributes("lxsh-0.8.6-2.all.rock")) |
97 | end) | 96 | end) |
98 | end) | 97 | end) |
99 | end) \ No newline at end of file | 98 | end) |
diff --git a/spec/new_version_spec.lua b/spec/new_version_spec.lua index 57014226..2274bce3 100644 --- a/spec/new_version_spec.lua +++ b/spec/new_version_spec.lua | |||
@@ -1,19 +1,18 @@ | |||
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 | ||
3 | 5 | ||
4 | test_env.unload_luarocks() | 6 | test_env.unload_luarocks() |
5 | local new_version = require("luarocks.new_version") | ||
6 | 7 | ||
7 | local extra_rocks = { | 8 | local extra_rocks = { |
8 | "/abelhas-1.0-1.rockspec" | 9 | "/abelhas-1.0-1.rockspec" |
9 | } | 10 | } |
10 | 11 | ||
11 | expose("LuaRocks new_version tests #blackbox #b_new_version", function() | 12 | describe("LuaRocks new_version tests #blackbox #b_new_version", function() |
12 | 13 | ||
13 | before_each(function() | 14 | before_each(function() |
14 | test_env.setup_specs(extra_rocks) | 15 | test_env.setup_specs(extra_rocks) |
15 | testing_paths = test_env.testing_paths | ||
16 | run = test_env.run | ||
17 | end) | 16 | end) |
18 | 17 | ||
19 | describe("LuaRocks new_version basic tests", function() | 18 | describe("LuaRocks new_version basic tests", function() |
@@ -50,4 +49,4 @@ expose("LuaRocks new_version tests #blackbox #b_new_version", function() | |||
50 | test_env.remove_files(lfs.currentdir(), "luacov--") | 49 | test_env.remove_files(lfs.currentdir(), "luacov--") |
51 | end) | 50 | end) |
52 | end) | 51 | end) |
53 | end) \ No newline at end of file | 52 | end) |
diff --git a/spec/pack_spec.lua b/spec/pack_spec.lua index a07e7ed2..416184a8 100644 --- a/spec/pack_spec.lua +++ b/spec/pack_spec.lua | |||
@@ -1,8 +1,8 @@ | |||
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 | ||
3 | 4 | ||
4 | test_env.unload_luarocks() | 5 | test_env.unload_luarocks() |
5 | local pack = require("luarocks.pack") | ||
6 | 6 | ||
7 | local extra_rocks = { | 7 | local extra_rocks = { |
8 | "/luasec-0.6-1.rockspec", | 8 | "/luasec-0.6-1.rockspec", |
@@ -10,12 +10,10 @@ local extra_rocks = { | |||
10 | "/luasocket-3.0rc1-1.rockspec" | 10 | "/luasocket-3.0rc1-1.rockspec" |
11 | } | 11 | } |
12 | 12 | ||
13 | expose("LuaRocks pack tests #blackbox #b_pack", function() | 13 | describe("LuaRocks pack tests #blackbox #b_pack", function() |
14 | 14 | ||
15 | before_each(function() | 15 | before_each(function() |
16 | test_env.setup_specs(extra_rocks) | 16 | test_env.setup_specs(extra_rocks) |
17 | testing_paths = test_env.testing_paths | ||
18 | run = test_env.run | ||
19 | end) | 17 | end) |
20 | 18 | ||
21 | it("LuaRocks pack basic", function() | 19 | it("LuaRocks pack basic", function() |
diff --git a/spec/path_spec.lua b/spec/path_spec.lua index 266ada89..22f07591 100644 --- a/spec/path_spec.lua +++ b/spec/path_spec.lua | |||
@@ -1,13 +1,11 @@ | |||
1 | local test_env = require("test/test_environment") | 1 | local test_env = require("test/test_environment") |
2 | local lfs = require("lfs") | 2 | local run = test_env.run |
3 | 3 | ||
4 | test_env.unload_luarocks() | 4 | test_env.unload_luarocks() |
5 | local path = require("luarocks.path") | ||
6 | 5 | ||
7 | expose("LuaRocks path tests #blackbox #b_path", function() | 6 | describe("LuaRocks path tests #blackbox #b_path", function() |
8 | before_each(function() | 7 | before_each(function() |
9 | test_env.setup_specs(extra_rocks) | 8 | test_env.setup_specs() |
10 | run = test_env.run | ||
11 | end) | 9 | end) |
12 | 10 | ||
13 | it("LuaRocks path bin", function() | 11 | it("LuaRocks path bin", function() |
diff --git a/spec/purge_spec.lua b/spec/purge_spec.lua index 639f96f3..09a9d433 100644 --- a/spec/purge_spec.lua +++ b/spec/purge_spec.lua | |||
@@ -1,14 +1,12 @@ | |||
1 | local test_env = require("test/test_environment") | 1 | local test_env = require("test/test_environment") |
2 | local lfs = require("lfs") | 2 | local run = test_env.run |
3 | local testing_paths = test_env.testing_paths | ||
3 | 4 | ||
4 | test_env.unload_luarocks() | 5 | test_env.unload_luarocks() |
5 | local purge = require("luarocks.purge") | ||
6 | 6 | ||
7 | expose("LuaRocks purge tests #blackbox #b_purge", function() | 7 | describe("LuaRocks purge tests #blackbox #b_purge", function() |
8 | before_each(function() | 8 | before_each(function() |
9 | test_env.setup_specs(extra_rocks) | 9 | test_env.setup_specs() |
10 | testing_paths = test_env.testing_paths | ||
11 | run = test_env.run | ||
12 | end) | 10 | end) |
13 | 11 | ||
14 | describe("LuaRocks purge basic tests", function() | 12 | describe("LuaRocks purge basic tests", function() |
diff --git a/spec/refresh_cache_spec.lua b/spec/refresh_cache_spec.lua index 27a95e5c..c20771ab 100644 --- a/spec/refresh_cache_spec.lua +++ b/spec/refresh_cache_spec.lua | |||
@@ -1,14 +1,12 @@ | |||
1 | local test_env = require("test/test_environment") | 1 | local test_env = require("test/test_environment") |
2 | local lfs = require("lfs") | 2 | local run = test_env.run |
3 | 3 | ||
4 | test_env.unload_luarocks() | 4 | test_env.unload_luarocks() |
5 | local refresh_cache = require("luarocks.refresh_cache") | ||
6 | 5 | ||
7 | expose("LuaRocks refresh_cache tests #blackbox #b_refresh_cache", function() | 6 | describe("LuaRocks refresh_cache tests #blackbox #b_refresh_cache", function() |
8 | 7 | ||
9 | before_each(function() | 8 | before_each(function() |
10 | test_env.setup_specs(extra_rocks) | 9 | test_env.setup_specs() |
11 | run = test_env.run | ||
12 | end) | 10 | end) |
13 | 11 | ||
14 | describe("LuaRocks-admin refresh cache tests #ssh", function() | 12 | describe("LuaRocks-admin refresh cache tests #ssh", function() |
@@ -16,4 +14,4 @@ expose("LuaRocks refresh_cache tests #blackbox #b_refresh_cache", function() | |||
16 | assert.is_true(run.luarocks_admin_bool("--server=testing refresh_cache")) | 14 | assert.is_true(run.luarocks_admin_bool("--server=testing refresh_cache")) |
17 | end) | 15 | end) |
18 | end) | 16 | end) |
19 | end) \ No newline at end of file | 17 | end) |
diff --git a/spec/remove_spec.lua b/spec/remove_spec.lua index a94673a8..41c6348a 100644 --- a/spec/remove_spec.lua +++ b/spec/remove_spec.lua | |||
@@ -1,8 +1,9 @@ | |||
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 | ||
3 | 5 | ||
4 | test_env.unload_luarocks() | 6 | test_env.unload_luarocks() |
5 | local remove = require("luarocks.remove") | ||
6 | 7 | ||
7 | local extra_rocks = { | 8 | local extra_rocks = { |
8 | "/abelhas-1.0-1.rockspec", | 9 | "/abelhas-1.0-1.rockspec", |
@@ -11,12 +12,10 @@ local extra_rocks = { | |||
11 | "/luasocket-3.0rc1-1.rockspec" | 12 | "/luasocket-3.0rc1-1.rockspec" |
12 | } | 13 | } |
13 | 14 | ||
14 | expose("LuaRocks remove tests #blackbox #b_remove", function() | 15 | describe("LuaRocks remove tests #blackbox #b_remove", function() |
15 | 16 | ||
16 | before_each(function() | 17 | before_each(function() |
17 | test_env.setup_specs(extra_rocks) | 18 | test_env.setup_specs(extra_rocks) |
18 | testing_paths = test_env.testing_paths | ||
19 | run = test_env.run | ||
20 | end) | 19 | end) |
21 | 20 | ||
22 | describe("LuaRocks remove basic tests", function() | 21 | describe("LuaRocks remove basic tests", function() |
@@ -82,4 +81,4 @@ expose("LuaRocks remove tests #blackbox #b_remove", function() | |||
82 | it("LuaRocks-admin remove missing", function() | 81 | it("LuaRocks-admin remove missing", function() |
83 | assert.is_false(run.luarocks_admin_bool("--server=testing remove")) | 82 | assert.is_false(run.luarocks_admin_bool("--server=testing remove")) |
84 | end) | 83 | end) |
85 | end) \ No newline at end of file | 84 | end) |
diff --git a/spec/search_spec.lua b/spec/search_spec.lua index a0258942..33c49856 100644 --- a/spec/search_spec.lua +++ b/spec/search_spec.lua | |||
@@ -1,18 +1,16 @@ | |||
1 | local test_env = require("test/test_environment") | 1 | local test_env = require("test/test_environment") |
2 | local lfs = require("lfs") | 2 | local run = test_env.run |
3 | 3 | ||
4 | test_env.unload_luarocks() | 4 | test_env.unload_luarocks() |
5 | local search = require("luarocks.search") | ||
6 | 5 | ||
7 | local extra_rocks = { | 6 | local extra_rocks = { |
8 | "/lzlib-0.4.1.53-1.src.rock" | 7 | "/lzlib-0.4.1.53-1.src.rock" |
9 | } | 8 | } |
10 | 9 | ||
11 | expose("LuaRocks search tests #blackbox #b_search", function() | 10 | describe("LuaRocks search tests #blackbox #b_search", function() |
12 | 11 | ||
13 | before_each(function() | 12 | before_each(function() |
14 | test_env.setup_specs(extra_rocks) | 13 | test_env.setup_specs(extra_rocks) |
15 | run = test_env.run | ||
16 | end) | 14 | end) |
17 | 15 | ||
18 | it("LuaRocks search with no flags/arguments", function() | 16 | it("LuaRocks search with no flags/arguments", function() |
@@ -39,4 +37,4 @@ expose("LuaRocks search tests #blackbox #b_search", function() | |||
39 | local num = 123 | 37 | local num = 123 |
40 | assert.is_true(run.luarocks_bool("search " .. num)) | 38 | assert.is_true(run.luarocks_bool("search " .. num)) |
41 | end) | 39 | end) |
42 | end) \ No newline at end of file | 40 | end) |
diff --git a/spec/show_spec.lua b/spec/show_spec.lua index 85797eb6..f528a6de 100644 --- a/spec/show_spec.lua +++ b/spec/show_spec.lua | |||
@@ -1,14 +1,12 @@ | |||
1 | local test_env = require("test/test_environment") | 1 | local test_env = require("test/test_environment") |
2 | local lfs = require("lfs") | 2 | local run = test_env.run |
3 | 3 | ||
4 | test_env.unload_luarocks() | 4 | test_env.unload_luarocks() |
5 | local show = require("luarocks.show") | ||
6 | 5 | ||
7 | expose("LuaRocks show tests #blackbox #b_show", function() | 6 | describe("LuaRocks show tests #blackbox #b_show", function() |
8 | 7 | ||
9 | before_each(function() | 8 | before_each(function() |
10 | test_env.setup_specs(extra_rocks) | 9 | test_env.setup_specs() |
11 | run = test_env.run | ||
12 | end) | 10 | end) |
13 | 11 | ||
14 | it("LuaRocks show with no flags/arguments", function() | 12 | it("LuaRocks show with no flags/arguments", function() |
diff --git a/spec/unpack_spec.lua b/spec/unpack_spec.lua index efe902f5..76e9e5a8 100644 --- a/spec/unpack_spec.lua +++ b/spec/unpack_spec.lua | |||
@@ -1,21 +1,18 @@ | |||
1 | local test_env = require("test/test_environment") | 1 | local test_env = require("test/test_environment") |
2 | local lfs = require("lfs") | 2 | local run = test_env.run |
3 | local testing_paths = test_env.testing_paths | ||
3 | 4 | ||
4 | test_env.unload_luarocks() | 5 | test_env.unload_luarocks() |
5 | local unpack = require("luarocks.unpack") | ||
6 | 6 | ||
7 | local extra_rocks = { | 7 | local extra_rocks = { |
8 | "/cprint-0.1-2.src.rock", | 8 | "/cprint-0.1-2.src.rock", |
9 | "/cprint-0.1-2.rockspec" | 9 | "/cprint-0.1-2.rockspec" |
10 | } | 10 | } |
11 | 11 | ||
12 | expose("LuaRocks unpack tests #blackbox #b_unpack", function() | 12 | describe("LuaRocks unpack tests #blackbox #b_unpack", function() |
13 | 13 | ||
14 | before_each(function() | 14 | before_each(function() |
15 | test_env.setup_specs(extra_rocks) | 15 | test_env.setup_specs(extra_rocks) |
16 | testing_paths = test_env.testing_paths | ||
17 | run = test_env.run | ||
18 | platform = test_env.platform | ||
19 | end) | 16 | end) |
20 | 17 | ||
21 | describe("LuaRocks unpack basic fail tests", function() | 18 | describe("LuaRocks unpack basic fail tests", function() |
@@ -51,9 +48,9 @@ expose("LuaRocks unpack tests #blackbox #b_unpack", function() | |||
51 | it("LuaRocks unpack binary", function() | 48 | it("LuaRocks unpack binary", function() |
52 | assert.is_true(run.luarocks_bool("build cprint")) | 49 | assert.is_true(run.luarocks_bool("build cprint")) |
53 | assert.is_true(run.luarocks_bool("pack cprint")) | 50 | assert.is_true(run.luarocks_bool("pack cprint")) |
54 | assert.is_true(run.luarocks_bool("unpack cprint-0.1-2." .. platform .. ".rock")) | 51 | assert.is_true(run.luarocks_bool("unpack cprint-0.1-2." .. test_env.platform .. ".rock")) |
55 | test_env.remove_dir("cprint-0.1-2") | 52 | test_env.remove_dir("cprint-0.1-2") |
56 | os.remove("cprint-0.1-2." .. platform .. ".rock") | 53 | os.remove("cprint-0.1-2." .. test_env.platform .. ".rock") |
57 | end) | 54 | end) |
58 | end) | 55 | end) |
59 | end) | 56 | end) |
diff --git a/spec/upload_spec.lua b/spec/upload_spec.lua index daf40d61..c10ef0e9 100644 --- a/spec/upload_spec.lua +++ b/spec/upload_spec.lua | |||
@@ -1,18 +1,16 @@ | |||
1 | local test_env = require("test/test_environment") | 1 | local test_env = require("test/test_environment") |
2 | local lfs = require("lfs") | 2 | local run = test_env.run |
3 | 3 | ||
4 | test_env.unload_luarocks() | 4 | test_env.unload_luarocks() |
5 | local upload = require("luarocks.upload") | ||
6 | 5 | ||
7 | local extra_rocks = { | 6 | local extra_rocks = { |
8 | "/lua-cjson-2.1.0-1.src.rock" | 7 | "/lua-cjson-2.1.0-1.src.rock" |
9 | } | 8 | } |
10 | 9 | ||
11 | expose("LuaRocks upload tests #blackbox #b_upload", function() | 10 | describe("LuaRocks upload tests #blackbox #b_upload", function() |
12 | 11 | ||
13 | before_each(function() | 12 | before_each(function() |
14 | test_env.setup_specs(extra_rocks) | 13 | test_env.setup_specs(extra_rocks) |
15 | run = test_env.run | ||
16 | end) | 14 | end) |
17 | 15 | ||
18 | it("LuaRocks upload with no flags/arguments", function() | 16 | it("LuaRocks upload with no flags/arguments", function() |
diff --git a/spec/util_spec.lua b/spec/util_spec.lua index 7c22d1cb..9118ffc9 100644 --- a/spec/util_spec.lua +++ b/spec/util_spec.lua | |||
@@ -1,13 +1,13 @@ | |||
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 | expose("Basic tests #blackbox #b_util", function() | 7 | describe("Basic tests #blackbox #b_util", function() |
5 | 8 | ||
6 | before_each(function() | 9 | before_each(function() |
7 | test_env.setup_specs(extra_rocks) | 10 | test_env.setup_specs() |
8 | testing_paths = test_env.testing_paths | ||
9 | env_variables = test_env.env_variables | ||
10 | run = test_env.run | ||
11 | end) | 11 | end) |
12 | 12 | ||
13 | it("LuaRocks version", function() | 13 | it("LuaRocks version", function() |
diff --git a/spec/write_rockspec_spec.lua b/spec/write_rockspec_spec.lua index d6e32f15..85e345d5 100644 --- a/spec/write_rockspec_spec.lua +++ b/spec/write_rockspec_spec.lua | |||
@@ -1,14 +1,13 @@ | |||
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 | ||
3 | 4 | ||
4 | test_env.unload_luarocks() | 5 | test_env.unload_luarocks() |
5 | local write_rockspec = require("luarocks.write_rockspec") | ||
6 | 6 | ||
7 | expose("LuaRocks write_rockspec tests #blackbox #b_write_rockspec", function() | 7 | describe("LuaRocks write_rockspec tests #blackbox #b_write_rockspec", function() |
8 | 8 | ||
9 | before_each(function() | 9 | before_each(function() |
10 | test_env.setup_specs(extra_rocks) | 10 | test_env.setup_specs() |
11 | run = test_env.run | ||
12 | end) | 11 | end) |
13 | 12 | ||
14 | describe("LuaRocks write_rockspec basic tests", function() | 13 | describe("LuaRocks write_rockspec basic tests", function() |
@@ -71,4 +70,4 @@ expose("LuaRocks write_rockspec tests #blackbox #b_write_rockspec", function() | |||
71 | assert.is_true(os.remove("luafcgi-scm-1.rockspec")) | 70 | assert.is_true(os.remove("luafcgi-scm-1.rockspec")) |
72 | end) | 71 | end) |
73 | end) | 72 | end) |
74 | end) \ No newline at end of file | 73 | end) |