aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Melnichenko <mpeterval@gmail.com>2016-07-08 14:41:15 +0300
committerPeter Melnichenko <mpeterval@gmail.com>2016-07-08 14:43:24 +0300
commitab86e13d0a408691b48786c394404736b7ac8dc0 (patch)
treeddbb2d397c302cda6dbd7dd5d8a8b4b6d275e3cc
parent8867f3324d97584ed24f3a1082144e9b1375d663 (diff)
downloadluarocks-ab86e13d0a408691b48786c394404736b7ac8dc0.tar.gz
luarocks-ab86e13d0a408691b48786c394404736b7ac8dc0.tar.bz2
luarocks-ab86e13d0a408691b48786c394404736b7ac8dc0.zip
Remove some more unused stuff and globals from tests
-rw-r--r--spec/config_spec.lua3
-rw-r--r--spec/deps_spec.lua2
-rw-r--r--spec/help_spec.lua2
-rw-r--r--spec/install_spec.lua11
-rw-r--r--spec/make_manifest_spec.lua2
-rw-r--r--spec/path_spec.lua2
-rw-r--r--spec/purge_spec.lua2
-rw-r--r--spec/refresh_cache_spec.lua2
-rw-r--r--spec/show_spec.lua2
-rw-r--r--spec/unpack_spec.lua5
-rw-r--r--spec/util_spec.lua2
-rw-r--r--spec/write_rockspec_spec.lua3
12 files changed, 17 insertions, 21 deletions
diff --git a/spec/config_spec.lua b/spec/config_spec.lua
index 4a09fdcf..0dee8620 100644
--- a/spec/config_spec.lua
+++ b/spec/config_spec.lua
@@ -2,13 +2,14 @@ local test_env = require("test/test_environment")
2local lfs = require("lfs") 2local lfs = require("lfs")
3local run = test_env.run 3local run = test_env.run
4local testing_paths = test_env.testing_paths 4local testing_paths = test_env.testing_paths
5local site_config
5 6
6test_env.unload_luarocks() 7test_env.unload_luarocks()
7 8
8describe("LuaRocks config tests #blackbox #b_config", function() 9describe("LuaRocks config tests #blackbox #b_config", function()
9 10
10 before_each(function() 11 before_each(function()
11 test_env.setup_specs(extra_rocks) 12 test_env.setup_specs()
12 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
13 site_config = require("luarocks.site_config") 14 site_config = require("luarocks.site_config")
14 end) 15 end)
diff --git a/spec/deps_spec.lua b/spec/deps_spec.lua
index 5df96452..c1bd404d 100644
--- a/spec/deps_spec.lua
+++ b/spec/deps_spec.lua
@@ -17,8 +17,6 @@ describe("LuaRocks deps tests #blackbox #b_deps", function()
17 17
18 before_each(function() 18 before_each(function()
19 test_env.setup_specs(extra_rocks) 19 test_env.setup_specs(extra_rocks)
20 testing_paths = test_env.testing_paths
21 run = test_env.run
22 end) 20 end)
23 21
24 it("LuaRocks deps mode one", function() 22 it("LuaRocks deps mode one", function()
diff --git a/spec/help_spec.lua b/spec/help_spec.lua
index 35bb6817..0d41e2e9 100644
--- a/spec/help_spec.lua
+++ b/spec/help_spec.lua
@@ -6,7 +6,7 @@ test_env.unload_luarocks()
6describe("LuaRocks help tests #blackbox #b_help", function() 6describe("LuaRocks help tests #blackbox #b_help", function()
7 7
8 before_each(function() 8 before_each(function()
9 test_env.setup_specs(extra_rocks) 9 test_env.setup_specs()
10 end) 10 end)
11 11
12 it("LuaRocks help with no flags/arguments", function() 12 it("LuaRocks help with no flags/arguments", function()
diff --git a/spec/install_spec.lua b/spec/install_spec.lua
index 876e25fc..0e406e22 100644
--- a/spec/install_spec.lua
+++ b/spec/install_spec.lua
@@ -25,7 +25,6 @@ describe("LuaRocks install tests #blackbox #b_install", function()
25 25
26 before_each(function() 26 before_each(function()
27 test_env.setup_specs(extra_rocks) 27 test_env.setup_specs(extra_rocks)
28 platform = test_env.platform
29 end) 28 end)
30 29
31 describe("LuaRocks install - basic tests", function() 30 describe("LuaRocks install - basic tests", function()
@@ -85,21 +84,21 @@ describe("LuaRocks install tests #blackbox #b_install", function()
85 84
86 it("LuaRocks install only-deps of luasocket packed rock", function() 85 it("LuaRocks install only-deps of luasocket packed rock", function()
87 assert.is_true(test_env.need_luasocket()) 86 assert.is_true(test_env.need_luasocket())
88 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")
89 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")
90 end) 89 end)
91 90
92 it("LuaRocks install binary rock of cprint", function() 91 it("LuaRocks install binary rock of cprint", function()
93 assert.is_true(test_env.need_luasocket()) 92 assert.is_true(test_env.need_luasocket())
94 assert.is_true(run.luarocks_bool("build --pack-binary-rock cprint")) 93 assert.is_true(run.luarocks_bool("build --pack-binary-rock cprint"))
95 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"))
96 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"))
97 end) 96 end)
98 97
99 it("LuaRocks install reinstall", function() 98 it("LuaRocks install reinstall", function()
100 assert.is_true(test_env.need_luasocket()) 99 assert.is_true(test_env.need_luasocket())
101 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"))
102 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"))
103 end) 102 end)
104 end) 103 end)
105 104
diff --git a/spec/make_manifest_spec.lua b/spec/make_manifest_spec.lua
index 5bd9e2f3..1c7f5bf8 100644
--- a/spec/make_manifest_spec.lua
+++ b/spec/make_manifest_spec.lua
@@ -6,7 +6,7 @@ test_env.unload_luarocks()
6describe("LuaRocks make_manifest tests #blackbox #b_make_manifest", function() 6describe("LuaRocks make_manifest tests #blackbox #b_make_manifest", function()
7 7
8 before_each(function() 8 before_each(function()
9 test_env.setup_specs(extra_rocks) 9 test_env.setup_specs()
10 end) 10 end)
11 11
12 describe("LuaRocks-admin make manifest tests", function() 12 describe("LuaRocks-admin make manifest tests", function()
diff --git a/spec/path_spec.lua b/spec/path_spec.lua
index fcdb36cf..22f07591 100644
--- a/spec/path_spec.lua
+++ b/spec/path_spec.lua
@@ -5,7 +5,7 @@ test_env.unload_luarocks()
5 5
6describe("LuaRocks path tests #blackbox #b_path", function() 6describe("LuaRocks path tests #blackbox #b_path", function()
7 before_each(function() 7 before_each(function()
8 test_env.setup_specs(extra_rocks) 8 test_env.setup_specs()
9 end) 9 end)
10 10
11 it("LuaRocks path bin", function() 11 it("LuaRocks path bin", function()
diff --git a/spec/purge_spec.lua b/spec/purge_spec.lua
index e6f12ddb..09a9d433 100644
--- a/spec/purge_spec.lua
+++ b/spec/purge_spec.lua
@@ -6,7 +6,7 @@ test_env.unload_luarocks()
6 6
7describe("LuaRocks purge tests #blackbox #b_purge", function() 7describe("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 end) 10 end)
11 11
12 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 34d211ab..c20771ab 100644
--- a/spec/refresh_cache_spec.lua
+++ b/spec/refresh_cache_spec.lua
@@ -6,7 +6,7 @@ test_env.unload_luarocks()
6describe("LuaRocks refresh_cache tests #blackbox #b_refresh_cache", function() 6describe("LuaRocks refresh_cache tests #blackbox #b_refresh_cache", function()
7 7
8 before_each(function() 8 before_each(function()
9 test_env.setup_specs(extra_rocks) 9 test_env.setup_specs()
10 end) 10 end)
11 11
12 describe("LuaRocks-admin refresh cache tests #ssh", function() 12 describe("LuaRocks-admin refresh cache tests #ssh", function()
diff --git a/spec/show_spec.lua b/spec/show_spec.lua
index 6f055612..f528a6de 100644
--- a/spec/show_spec.lua
+++ b/spec/show_spec.lua
@@ -6,7 +6,7 @@ test_env.unload_luarocks()
6describe("LuaRocks show tests #blackbox #b_show", function() 6describe("LuaRocks show tests #blackbox #b_show", function()
7 7
8 before_each(function() 8 before_each(function()
9 test_env.setup_specs(extra_rocks) 9 test_env.setup_specs()
10 end) 10 end)
11 11
12 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 db71aa06..76e9e5a8 100644
--- a/spec/unpack_spec.lua
+++ b/spec/unpack_spec.lua
@@ -13,7 +13,6 @@ 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 platform = test_env.platform
17 end) 16 end)
18 17
19 describe("LuaRocks unpack basic fail tests", function() 18 describe("LuaRocks unpack basic fail tests", function()
@@ -49,9 +48,9 @@ describe("LuaRocks unpack tests #blackbox #b_unpack", function()
49 it("LuaRocks unpack binary", function() 48 it("LuaRocks unpack binary", function()
50 assert.is_true(run.luarocks_bool("build cprint")) 49 assert.is_true(run.luarocks_bool("build cprint"))
51 assert.is_true(run.luarocks_bool("pack cprint")) 50 assert.is_true(run.luarocks_bool("pack cprint"))
52 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"))
53 test_env.remove_dir("cprint-0.1-2") 52 test_env.remove_dir("cprint-0.1-2")
54 os.remove("cprint-0.1-2." .. platform .. ".rock") 53 os.remove("cprint-0.1-2." .. test_env.platform .. ".rock")
55 end) 54 end)
56 end) 55 end)
57end) 56end)
diff --git a/spec/util_spec.lua b/spec/util_spec.lua
index 39ce3c83..9118ffc9 100644
--- a/spec/util_spec.lua
+++ b/spec/util_spec.lua
@@ -7,7 +7,7 @@ local env_variables = test_env.env_variables
7describe("Basic tests #blackbox #b_util", function() 7describe("Basic tests #blackbox #b_util", function()
8 8
9 before_each(function() 9 before_each(function()
10 test_env.setup_specs(extra_rocks) 10 test_env.setup_specs()
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 cf0a642e..85e345d5 100644
--- a/spec/write_rockspec_spec.lua
+++ b/spec/write_rockspec_spec.lua
@@ -3,12 +3,11 @@ local lfs = require("lfs")
3local run = test_env.run 3local run = test_env.run
4 4
5test_env.unload_luarocks() 5test_env.unload_luarocks()
6local write_rockspec = require("luarocks.write_rockspec")
7 6
8describe("LuaRocks write_rockspec tests #blackbox #b_write_rockspec", function() 7describe("LuaRocks write_rockspec tests #blackbox #b_write_rockspec", function()
9 8
10 before_each(function() 9 before_each(function()
11 test_env.setup_specs(extra_rocks) 10 test_env.setup_specs()
12 end) 11 end)
13 12
14 describe("LuaRocks write_rockspec basic tests", function() 13 describe("LuaRocks write_rockspec basic tests", function()