diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2017-10-04 11:14:42 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-04 11:14:42 -0300 |
| commit | 84b4fe99cac37850a97858e0b641043bd3178d8a (patch) | |
| tree | b4578689091b8360aed71f531faf2513b7d41684 /spec/config_spec.lua | |
| parent | 100c18d048936b5a47f29f55e6ce8b24277fb70f (diff) | |
| download | luarocks-84b4fe99cac37850a97858e0b641043bd3178d8a.tar.gz luarocks-84b4fe99cac37850a97858e0b641043bd3178d8a.tar.bz2 luarocks-84b4fe99cac37850a97858e0b641043bd3178d8a.zip | |
Use versioned files only. (#734)
Let's take the opportunity of a new major version to make an important cleanup: getting rid of the error-prone unversioned configuration files. This drops support for:
* Unversioned config.lua -> use config-5.x.lua
* Unversioned luarocks/site_config.lua -> it always generates luarocks/core/site_config_5_x.lua
* Unversioned lib/luarocks/rocks -> it always uses lib/luarocks/rocks-5.x
Diffstat (limited to 'spec/config_spec.lua')
| -rw-r--r-- | spec/config_spec.lua | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/spec/config_spec.lua b/spec/config_spec.lua index cdb5ccc4..6be586c2 100644 --- a/spec/config_spec.lua +++ b/spec/config_spec.lua | |||
| @@ -12,7 +12,7 @@ describe("LuaRocks config tests #blackbox #b_config", function() | |||
| 12 | before_each(function() | 12 | before_each(function() |
| 13 | test_env.setup_specs() | 13 | test_env.setup_specs() |
| 14 | test_env.unload_luarocks() -- need to be required here, because site_config is created after first loading of specs | 14 | test_env.unload_luarocks() -- need to be required here, because site_config is created after first loading of specs |
| 15 | site_config = require("luarocks.site_config") | 15 | site_config = require("luarocks.core.site_config_" .. test_env.lua_version:gsub("%.", "_")) |
| 16 | end) | 16 | end) |
| 17 | 17 | ||
| 18 | describe("LuaRocks config - basic tests", function() | 18 | describe("LuaRocks config - basic tests", function() |
| @@ -64,15 +64,7 @@ describe("LuaRocks config tests #blackbox #b_config", function() | |||
| 64 | 64 | ||
| 65 | describe("LuaRocks config - more complex tests", function() | 65 | describe("LuaRocks config - more complex tests", function() |
| 66 | local scdir = testing_paths.testing_lrprefix .. "/etc/luarocks" | 66 | local scdir = testing_paths.testing_lrprefix .. "/etc/luarocks" |
| 67 | local versioned_scname = scdir .. "/config-" .. env_variables.LUA_VERSION .. ".lua" | 67 | local configfile = scdir .. "/config-" .. env_variables.LUA_VERSION .. ".lua" |
| 68 | local scname = scdir .. "/config.lua" | ||
| 69 | |||
| 70 | local configfile | ||
| 71 | if test_env.TEST_TARGET_OS == "windows" then | ||
| 72 | configfile = versioned_scname | ||
| 73 | else | ||
| 74 | configfile = scname | ||
| 75 | end | ||
| 76 | 68 | ||
| 77 | it("LuaRocks fail system config", function() | 69 | it("LuaRocks fail system config", function() |
| 78 | os.rename(configfile, configfile .. ".bak") | 70 | os.rename(configfile, configfile .. ".bak") |
