From 8867f3324d97584ed24f3a1082144e9b1375d663 Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Fri, 8 Jul 2016 14:30:00 +0300 Subject: Make env vars, paths and run commands available on test env load --- spec/add_spec.lua | 4 ++-- spec/build_spec.lua | 4 ++-- spec/config_spec.lua | 4 ++-- spec/deps_spec.lua | 2 ++ spec/doc_spec.lua | 3 +-- spec/download_spec.lua | 2 +- spec/help_spec.lua | 2 +- spec/install_spec.lua | 6 +++--- spec/lint_spec.lua | 4 ++-- spec/list_spec.lua | 4 ++-- spec/make_manifest_spec.lua | 2 +- spec/make_spec.lua | 4 ++-- spec/new_version_spec.lua | 4 ++-- spec/pack_spec.lua | 3 +-- spec/path_spec.lua | 2 +- spec/purge_spec.lua | 4 ++-- spec/refresh_cache_spec.lua | 2 +- spec/remove_spec.lua | 4 ++-- spec/search_spec.lua | 2 +- spec/show_spec.lua | 2 +- spec/unpack_spec.lua | 4 ++-- spec/upload_spec.lua | 2 +- spec/util_spec.lua | 6 +++--- spec/write_rockspec_spec.lua | 4 ++-- 24 files changed, 40 insertions(+), 40 deletions(-) (limited to 'spec') diff --git a/spec/add_spec.lua b/spec/add_spec.lua index 930c221d..dca6f850 100644 --- a/spec/add_spec.lua +++ b/spec/add_spec.lua @@ -1,4 +1,6 @@ local test_env = require("test/test_environment") +local run = test_env.run +local testing_paths = test_env.testing_paths test_env.unload_luarocks() @@ -11,8 +13,6 @@ describe("LuaRocks add tests #blackbox #b_add", function() before_each(function() test_env.setup_specs(extra_rocks) - testing_paths = test_env.testing_paths - run = test_env.run end) describe("LuaRocks-admin add tests", function() diff --git a/spec/build_spec.lua b/spec/build_spec.lua index 7248e8f0..1ce99089 100644 --- a/spec/build_spec.lua +++ b/spec/build_spec.lua @@ -1,5 +1,7 @@ local test_env = require("test/test_environment") local lfs = require("lfs") +local run = test_env.run +local testing_paths = test_env.testing_paths test_env.unload_luarocks() @@ -29,8 +31,6 @@ describe("LuaRocks build tests #blackbox #b_build", function() before_each(function() test_env.setup_specs(extra_rocks) - testing_paths = test_env.testing_paths - run = test_env.run end) describe("LuaRocks build - basic testing set", function() diff --git a/spec/config_spec.lua b/spec/config_spec.lua index df2480ac..4a09fdcf 100644 --- a/spec/config_spec.lua +++ b/spec/config_spec.lua @@ -1,5 +1,7 @@ local test_env = require("test/test_environment") local lfs = require("lfs") +local run = test_env.run +local testing_paths = test_env.testing_paths test_env.unload_luarocks() @@ -9,8 +11,6 @@ describe("LuaRocks config tests #blackbox #b_config", function() test_env.setup_specs(extra_rocks) 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") - testing_paths = test_env.testing_paths - run = test_env.run end) describe("LuaRocks config - basic tests", function() diff --git a/spec/deps_spec.lua b/spec/deps_spec.lua index 9bb4709d..5df96452 100644 --- a/spec/deps_spec.lua +++ b/spec/deps_spec.lua @@ -1,5 +1,7 @@ local test_env = require("test/test_environment") local lfs = require("lfs") +local run = test_env.run +local testing_paths = test_env.testing_paths test_env.unload_luarocks() diff --git a/spec/doc_spec.lua b/spec/doc_spec.lua index e4e7f5f2..9dbeaab8 100644 --- a/spec/doc_spec.lua +++ b/spec/doc_spec.lua @@ -1,4 +1,5 @@ local test_env = require("test/test_environment") +local run = test_env.run test_env.unload_luarocks() @@ -10,8 +11,6 @@ describe("LuaRocks doc tests #blackbox #b_doc", function() before_each(function() test_env.setup_specs(extra_rocks) - testing_paths = test_env.testing_paths - run = test_env.run end) describe("LuaRocks doc basic tests", function() diff --git a/spec/download_spec.lua b/spec/download_spec.lua index 2485960d..320d9304 100644 --- a/spec/download_spec.lua +++ b/spec/download_spec.lua @@ -1,5 +1,6 @@ local test_env = require("test/test_environment") local lfs = require("lfs") +local run = test_env.run test_env.unload_luarocks() @@ -11,7 +12,6 @@ describe("LuaRocks download tests #blackbox #b_download", function() before_each(function() test_env.setup_specs(extra_rocks) - run = test_env.run end) it("LuaRocks download with no flags/arguments", function() diff --git a/spec/help_spec.lua b/spec/help_spec.lua index 376b6ceb..35bb6817 100644 --- a/spec/help_spec.lua +++ b/spec/help_spec.lua @@ -1,4 +1,5 @@ local test_env = require("test/test_environment") +local run = test_env.run test_env.unload_luarocks() @@ -6,7 +7,6 @@ describe("LuaRocks help tests #blackbox #b_help", function() before_each(function() test_env.setup_specs(extra_rocks) - run = test_env.run end) it("LuaRocks help with no flags/arguments", function() diff --git a/spec/install_spec.lua b/spec/install_spec.lua index f8869791..876e25fc 100644 --- a/spec/install_spec.lua +++ b/spec/install_spec.lua @@ -1,5 +1,8 @@ local test_env = require("test/test_environment") local lfs = require("lfs") +local run = test_env.run +local testing_paths = test_env.testing_paths +local env_variables = test_env.env_variables test_env.unload_luarocks() @@ -22,9 +25,6 @@ describe("LuaRocks install tests #blackbox #b_install", function() before_each(function() test_env.setup_specs(extra_rocks) - testing_paths = test_env.testing_paths - env_variables = test_env.env_variables - run = test_env.run platform = test_env.platform end) diff --git a/spec/lint_spec.lua b/spec/lint_spec.lua index ce753618..f7496037 100644 --- a/spec/lint_spec.lua +++ b/spec/lint_spec.lua @@ -1,4 +1,6 @@ local test_env = require("test/test_environment") +local run = test_env.run +local testing_paths = test_env.testing_paths test_env.unload_luarocks() @@ -10,8 +12,6 @@ describe("LuaRocks lint tests #blackbox #b_lint", function() before_each(function() test_env.setup_specs(extra_rocks) - testing_paths = test_env.testing_paths - run = test_env.run end) it("LuaRocks lint with no flags/arguments", function() diff --git a/spec/list_spec.lua b/spec/list_spec.lua index 344607e3..1b082ab6 100644 --- a/spec/list_spec.lua +++ b/spec/list_spec.lua @@ -1,4 +1,6 @@ local test_env = require("test/test_environment") +local run = test_env.run +local testing_paths = test_env.testing_paths test_env.unload_luarocks() @@ -11,8 +13,6 @@ describe("LuaRocks list tests #blackbox #b_list", function() before_each(function() test_env.setup_specs(extra_rocks) - run = test_env.run - testing_paths = test_env.testing_paths end) it("LuaRocks list with no flags/arguments", function() diff --git a/spec/make_manifest_spec.lua b/spec/make_manifest_spec.lua index c6b0753c..5bd9e2f3 100644 --- a/spec/make_manifest_spec.lua +++ b/spec/make_manifest_spec.lua @@ -1,4 +1,5 @@ local test_env = require("test/test_environment") +local run = test_env.run test_env.unload_luarocks() @@ -6,7 +7,6 @@ describe("LuaRocks make_manifest tests #blackbox #b_make_manifest", function() before_each(function() test_env.setup_specs(extra_rocks) - run = test_env.run end) describe("LuaRocks-admin make manifest tests", function() diff --git a/spec/make_spec.lua b/spec/make_spec.lua index 5ae23fd5..2821c143 100644 --- a/spec/make_spec.lua +++ b/spec/make_spec.lua @@ -1,5 +1,7 @@ local test_env = require("test/test_environment") local lfs = require("lfs") +local run = test_env.run +local testing_paths = test_env.testing_paths test_env.unload_luarocks() @@ -15,8 +17,6 @@ describe("LuaRocks make tests #blackbox #b_make", function() before_each(function() test_env.setup_specs(extra_rocks) - run = test_env.run - testing_paths = test_env.testing_paths end) it("LuaRocks make with no flags/arguments", function() diff --git a/spec/new_version_spec.lua b/spec/new_version_spec.lua index 140c9906..2274bce3 100644 --- a/spec/new_version_spec.lua +++ b/spec/new_version_spec.lua @@ -1,5 +1,7 @@ local test_env = require("test/test_environment") local lfs = require("lfs") +local run = test_env.run +local testing_paths = test_env.testing_paths test_env.unload_luarocks() @@ -11,8 +13,6 @@ describe("LuaRocks new_version tests #blackbox #b_new_version", function() before_each(function() test_env.setup_specs(extra_rocks) - testing_paths = test_env.testing_paths - run = test_env.run end) describe("LuaRocks new_version basic tests", function() diff --git a/spec/pack_spec.lua b/spec/pack_spec.lua index 1671152c..416184a8 100644 --- a/spec/pack_spec.lua +++ b/spec/pack_spec.lua @@ -1,5 +1,6 @@ local test_env = require("test/test_environment") local lfs = require("lfs") +local run = test_env.run test_env.unload_luarocks() @@ -13,8 +14,6 @@ describe("LuaRocks pack tests #blackbox #b_pack", function() before_each(function() test_env.setup_specs(extra_rocks) - testing_paths = test_env.testing_paths - run = test_env.run end) it("LuaRocks pack basic", function() diff --git a/spec/path_spec.lua b/spec/path_spec.lua index d201f337..fcdb36cf 100644 --- a/spec/path_spec.lua +++ b/spec/path_spec.lua @@ -1,11 +1,11 @@ local test_env = require("test/test_environment") +local run = test_env.run test_env.unload_luarocks() describe("LuaRocks path tests #blackbox #b_path", function() before_each(function() test_env.setup_specs(extra_rocks) - run = test_env.run end) it("LuaRocks path bin", function() diff --git a/spec/purge_spec.lua b/spec/purge_spec.lua index 30ce15e2..e6f12ddb 100644 --- a/spec/purge_spec.lua +++ b/spec/purge_spec.lua @@ -1,12 +1,12 @@ local test_env = require("test/test_environment") +local run = test_env.run +local testing_paths = test_env.testing_paths test_env.unload_luarocks() describe("LuaRocks purge tests #blackbox #b_purge", function() before_each(function() test_env.setup_specs(extra_rocks) - testing_paths = test_env.testing_paths - run = test_env.run end) describe("LuaRocks purge basic tests", function() diff --git a/spec/refresh_cache_spec.lua b/spec/refresh_cache_spec.lua index 764cbcb5..34d211ab 100644 --- a/spec/refresh_cache_spec.lua +++ b/spec/refresh_cache_spec.lua @@ -1,4 +1,5 @@ local test_env = require("test/test_environment") +local run = test_env.run test_env.unload_luarocks() @@ -6,7 +7,6 @@ describe("LuaRocks refresh_cache tests #blackbox #b_refresh_cache", function() before_each(function() test_env.setup_specs(extra_rocks) - run = test_env.run end) describe("LuaRocks-admin refresh cache tests #ssh", function() diff --git a/spec/remove_spec.lua b/spec/remove_spec.lua index 4129e755..41c6348a 100644 --- a/spec/remove_spec.lua +++ b/spec/remove_spec.lua @@ -1,5 +1,7 @@ local test_env = require("test/test_environment") local lfs = require("lfs") +local run = test_env.run +local testing_paths = test_env.testing_paths test_env.unload_luarocks() @@ -14,8 +16,6 @@ describe("LuaRocks remove tests #blackbox #b_remove", function() before_each(function() test_env.setup_specs(extra_rocks) - testing_paths = test_env.testing_paths - run = test_env.run end) describe("LuaRocks remove basic tests", function() diff --git a/spec/search_spec.lua b/spec/search_spec.lua index 93e85928..33c49856 100644 --- a/spec/search_spec.lua +++ b/spec/search_spec.lua @@ -1,4 +1,5 @@ local test_env = require("test/test_environment") +local run = test_env.run test_env.unload_luarocks() @@ -10,7 +11,6 @@ describe("LuaRocks search tests #blackbox #b_search", function() before_each(function() test_env.setup_specs(extra_rocks) - run = test_env.run end) it("LuaRocks search with no flags/arguments", function() diff --git a/spec/show_spec.lua b/spec/show_spec.lua index a58eea52..6f055612 100644 --- a/spec/show_spec.lua +++ b/spec/show_spec.lua @@ -1,4 +1,5 @@ local test_env = require("test/test_environment") +local run = test_env.run test_env.unload_luarocks() @@ -6,7 +7,6 @@ describe("LuaRocks show tests #blackbox #b_show", function() before_each(function() test_env.setup_specs(extra_rocks) - run = test_env.run end) it("LuaRocks show with no flags/arguments", function() diff --git a/spec/unpack_spec.lua b/spec/unpack_spec.lua index 1e9df811..db71aa06 100644 --- a/spec/unpack_spec.lua +++ b/spec/unpack_spec.lua @@ -1,4 +1,6 @@ local test_env = require("test/test_environment") +local run = test_env.run +local testing_paths = test_env.testing_paths test_env.unload_luarocks() @@ -11,8 +13,6 @@ describe("LuaRocks unpack tests #blackbox #b_unpack", function() before_each(function() test_env.setup_specs(extra_rocks) - testing_paths = test_env.testing_paths - run = test_env.run platform = test_env.platform end) diff --git a/spec/upload_spec.lua b/spec/upload_spec.lua index ce998987..c10ef0e9 100644 --- a/spec/upload_spec.lua +++ b/spec/upload_spec.lua @@ -1,4 +1,5 @@ local test_env = require("test/test_environment") +local run = test_env.run test_env.unload_luarocks() @@ -10,7 +11,6 @@ describe("LuaRocks upload tests #blackbox #b_upload", function() before_each(function() test_env.setup_specs(extra_rocks) - run = test_env.run end) it("LuaRocks upload with no flags/arguments", function() diff --git a/spec/util_spec.lua b/spec/util_spec.lua index 7e0289d6..39ce3c83 100644 --- a/spec/util_spec.lua +++ b/spec/util_spec.lua @@ -1,13 +1,13 @@ local test_env = require("test/test_environment") local lfs = require("lfs") +local run = test_env.run +local testing_paths = test_env.testing_paths +local env_variables = test_env.env_variables describe("Basic tests #blackbox #b_util", function() before_each(function() test_env.setup_specs(extra_rocks) - testing_paths = test_env.testing_paths - env_variables = test_env.env_variables - run = test_env.run end) it("LuaRocks version", function() diff --git a/spec/write_rockspec_spec.lua b/spec/write_rockspec_spec.lua index 4c29f204..cf0a642e 100644 --- a/spec/write_rockspec_spec.lua +++ b/spec/write_rockspec_spec.lua @@ -1,5 +1,6 @@ local test_env = require("test/test_environment") local lfs = require("lfs") +local run = test_env.run test_env.unload_luarocks() local write_rockspec = require("luarocks.write_rockspec") @@ -8,7 +9,6 @@ describe("LuaRocks write_rockspec tests #blackbox #b_write_rockspec", function() before_each(function() test_env.setup_specs(extra_rocks) - run = test_env.run end) describe("LuaRocks write_rockspec basic tests", function() @@ -71,4 +71,4 @@ describe("LuaRocks write_rockspec tests #blackbox #b_write_rockspec", function() assert.is_true(os.remove("luafcgi-scm-1.rockspec")) end) end) -end) \ No newline at end of file +end) -- cgit v1.2.3-55-g6feb