From ab86e13d0a408691b48786c394404736b7ac8dc0 Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Fri, 8 Jul 2016 14:41:15 +0300 Subject: Remove some more unused stuff and globals from tests --- spec/config_spec.lua | 3 ++- spec/deps_spec.lua | 2 -- spec/help_spec.lua | 2 +- spec/install_spec.lua | 11 +++++------ spec/make_manifest_spec.lua | 2 +- spec/path_spec.lua | 2 +- spec/purge_spec.lua | 2 +- spec/refresh_cache_spec.lua | 2 +- spec/show_spec.lua | 2 +- spec/unpack_spec.lua | 5 ++--- spec/util_spec.lua | 2 +- spec/write_rockspec_spec.lua | 3 +-- 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") local lfs = require("lfs") local run = test_env.run local testing_paths = test_env.testing_paths +local site_config test_env.unload_luarocks() describe("LuaRocks config tests #blackbox #b_config", function() before_each(function() - test_env.setup_specs(extra_rocks) + test_env.setup_specs() test_env.unload_luarocks() -- need to be required here, because site_config is created after first loading of specs site_config = require("luarocks.site_config") 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() before_each(function() test_env.setup_specs(extra_rocks) - testing_paths = test_env.testing_paths - run = test_env.run end) 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() describe("LuaRocks help tests #blackbox #b_help", function() before_each(function() - test_env.setup_specs(extra_rocks) + test_env.setup_specs() end) 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() before_each(function() test_env.setup_specs(extra_rocks) - platform = test_env.platform end) describe("LuaRocks install - basic tests", function() @@ -85,21 +84,21 @@ describe("LuaRocks install tests #blackbox #b_install", function() it("LuaRocks install only-deps of luasocket packed rock", function() assert.is_true(test_env.need_luasocket()) - local output = run.luarocks("install --only-deps " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. platform .. ".rock") + local output = run.luarocks("install --only-deps " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. test_env.platform .. ".rock") assert.are.same(output, "Successfully installed dependencies for luasocket 3.0rc1-1") end) it("LuaRocks install binary rock of cprint", function() assert.is_true(test_env.need_luasocket()) assert.is_true(run.luarocks_bool("build --pack-binary-rock cprint")) - assert.is_true(run.luarocks_bool("install cprint-0.1-2." .. platform .. ".rock")) - assert.is_true(os.remove("cprint-0.1-2." .. platform .. ".rock")) + assert.is_true(run.luarocks_bool("install cprint-0.1-2." .. test_env.platform .. ".rock")) + assert.is_true(os.remove("cprint-0.1-2." .. test_env.platform .. ".rock")) end) it("LuaRocks install reinstall", function() assert.is_true(test_env.need_luasocket()) - assert.is_true(run.luarocks_bool("install " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. platform .. ".rock")) - assert.is_true(run.luarocks_bool("install --deps-mode=none " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. platform .. ".rock")) + assert.is_true(run.luarocks_bool("install " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. test_env.platform .. ".rock")) + assert.is_true(run.luarocks_bool("install --deps-mode=none " .. testing_paths.testing_cache .. "/luasocket-3.0rc1-1." .. test_env.platform .. ".rock")) end) end) 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() describe("LuaRocks make_manifest tests #blackbox #b_make_manifest", function() before_each(function() - test_env.setup_specs(extra_rocks) + test_env.setup_specs() end) 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() describe("LuaRocks path tests #blackbox #b_path", function() before_each(function() - test_env.setup_specs(extra_rocks) + test_env.setup_specs() end) 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() describe("LuaRocks purge tests #blackbox #b_purge", function() before_each(function() - test_env.setup_specs(extra_rocks) + test_env.setup_specs() end) 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() describe("LuaRocks refresh_cache tests #blackbox #b_refresh_cache", function() before_each(function() - test_env.setup_specs(extra_rocks) + test_env.setup_specs() end) 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() describe("LuaRocks show tests #blackbox #b_show", function() before_each(function() - test_env.setup_specs(extra_rocks) + test_env.setup_specs() end) 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() before_each(function() test_env.setup_specs(extra_rocks) - platform = test_env.platform end) describe("LuaRocks unpack basic fail tests", function() @@ -49,9 +48,9 @@ describe("LuaRocks unpack tests #blackbox #b_unpack", function() it("LuaRocks unpack binary", function() assert.is_true(run.luarocks_bool("build cprint")) assert.is_true(run.luarocks_bool("pack cprint")) - assert.is_true(run.luarocks_bool("unpack cprint-0.1-2." .. platform .. ".rock")) + assert.is_true(run.luarocks_bool("unpack cprint-0.1-2." .. test_env.platform .. ".rock")) test_env.remove_dir("cprint-0.1-2") - os.remove("cprint-0.1-2." .. platform .. ".rock") + os.remove("cprint-0.1-2." .. test_env.platform .. ".rock") end) end) end) 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 describe("Basic tests #blackbox #b_util", function() before_each(function() - test_env.setup_specs(extra_rocks) + test_env.setup_specs() end) 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") local run = test_env.run test_env.unload_luarocks() -local write_rockspec = require("luarocks.write_rockspec") describe("LuaRocks write_rockspec tests #blackbox #b_write_rockspec", function() before_each(function() - test_env.setup_specs(extra_rocks) + test_env.setup_specs() end) describe("LuaRocks write_rockspec basic tests", function() -- cgit v1.2.3-55-g6feb