diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2018-06-19 09:58:36 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-07-01 15:51:09 -0300 |
| commit | a55f09fae00cb3c575f926eda4d76e81ff37b2ba (patch) | |
| tree | c36d2d475549f76805b3b9bfd08f1429f032e5ac /spec | |
| parent | 392f67d65a950fcf08a08d10d21e80f359160262 (diff) | |
| download | luarocks-a55f09fae00cb3c575f926eda4d76e81ff37b2ba.tar.gz luarocks-a55f09fae00cb3c575f926eda4d76e81ff37b2ba.tar.bz2 luarocks-a55f09fae00cb3c575f926eda4d76e81ff37b2ba.zip | |
fs: make module loading side-effect free, require explicit init()
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/fetch_spec.lua | 2 | ||||
| -rw-r--r-- | spec/fs_spec.lua | 1 | ||||
| -rw-r--r-- | spec/test_spec.lua | 3 | ||||
| -rw-r--r-- | spec/tools_spec.lua | 3 |
4 files changed, 8 insertions, 1 deletions
diff --git a/spec/fetch_spec.lua b/spec/fetch_spec.lua index ce4cfb56..6e00bc22 100644 --- a/spec/fetch_spec.lua +++ b/spec/fetch_spec.lua | |||
| @@ -3,6 +3,7 @@ local git_repo = require("spec.util.git_repo") | |||
| 3 | 3 | ||
| 4 | test_env.unload_luarocks() | 4 | test_env.unload_luarocks() |
| 5 | test_env.setup_specs() | 5 | test_env.setup_specs() |
| 6 | local fs = require("luarocks.fs") | ||
| 6 | local fetch = require("luarocks.fetch") | 7 | local fetch = require("luarocks.fetch") |
| 7 | local fs = require("luarocks.fs") | 8 | local fs = require("luarocks.fs") |
| 8 | local path = require("luarocks.path") | 9 | local path = require("luarocks.path") |
| @@ -20,6 +21,7 @@ describe("Luarocks fetch test #unit #mock", function() | |||
| 20 | local runner | 21 | local runner |
| 21 | 22 | ||
| 22 | setup(function() | 23 | setup(function() |
| 24 | fs.init() | ||
| 23 | test_env.mock_server_init() | 25 | test_env.mock_server_init() |
| 24 | 26 | ||
| 25 | runner = require("luacov.runner") | 27 | runner = require("luacov.runner") |
diff --git a/spec/fs_spec.lua b/spec/fs_spec.lua index 9b2aa01b..b8091f75 100644 --- a/spec/fs_spec.lua +++ b/spec/fs_spec.lua | |||
| @@ -55,6 +55,7 @@ describe("Luarocks fs test #unit", function() | |||
| 55 | local runner | 55 | local runner |
| 56 | 56 | ||
| 57 | setup(function() | 57 | setup(function() |
| 58 | fs.init() | ||
| 58 | runner = require("luacov.runner") | 59 | runner = require("luacov.runner") |
| 59 | runner.init(testing_paths.testrun_dir .. "/luacov.config") | 60 | runner.init(testing_paths.testrun_dir .. "/luacov.config") |
| 60 | runner.tick = true | 61 | runner.tick = true |
diff --git a/spec/test_spec.lua b/spec/test_spec.lua index 0111f89a..7a2399a9 100644 --- a/spec/test_spec.lua +++ b/spec/test_spec.lua | |||
| @@ -82,6 +82,7 @@ end) | |||
| 82 | test_env.unload_luarocks() | 82 | test_env.unload_luarocks() |
| 83 | 83 | ||
| 84 | local fs = require("luarocks.fs") | 84 | local fs = require("luarocks.fs") |
| 85 | local cfg = require("luarocks.core.cfg") | ||
| 85 | local path = require("luarocks.path") | 86 | local path = require("luarocks.path") |
| 86 | local test = require("luarocks.test") | 87 | local test = require("luarocks.test") |
| 87 | local test_busted = require("luarocks.test.busted") | 88 | local test_busted = require("luarocks.test.busted") |
| @@ -91,6 +92,8 @@ describe("LuaRocks test #unit", function() | |||
| 91 | local runner | 92 | local runner |
| 92 | 93 | ||
| 93 | setup(function() | 94 | setup(function() |
| 95 | cfg.init() | ||
| 96 | fs.init() | ||
| 94 | runner = require("luacov.runner") | 97 | runner = require("luacov.runner") |
| 95 | runner.init(testing_paths.testrun_dir .. "/luacov.config") | 98 | runner.init(testing_paths.testrun_dir .. "/luacov.config") |
| 96 | runner.tick = true | 99 | runner.tick = true |
diff --git a/spec/tools_spec.lua b/spec/tools_spec.lua index 8805d703..10dafb0b 100644 --- a/spec/tools_spec.lua +++ b/spec/tools_spec.lua | |||
| @@ -5,7 +5,7 @@ local write_file = test_env.write_file | |||
| 5 | 5 | ||
| 6 | test_env.unload_luarocks() | 6 | test_env.unload_luarocks() |
| 7 | local fs = require("luarocks.fs") | 7 | local fs = require("luarocks.fs") |
| 8 | local patch = package.loaded["luarocks.tools.patch"] | 8 | local patch = require("luarocks.tools.patch") |
| 9 | 9 | ||
| 10 | local lao = | 10 | local lao = |
| 11 | [[The Nameless is the origin of Heaven and Earth; | 11 | [[The Nameless is the origin of Heaven and Earth; |
| @@ -148,6 +148,7 @@ describe("Luarocks patch test #unit", function() | |||
| 148 | local runner | 148 | local runner |
| 149 | 149 | ||
| 150 | setup(function() | 150 | setup(function() |
| 151 | fs.init() | ||
| 151 | runner = require("luacov.runner") | 152 | runner = require("luacov.runner") |
| 152 | runner.init(testing_paths.testrun_dir .. "/luacov.config") | 153 | runner.init(testing_paths.testrun_dir .. "/luacov.config") |
| 153 | runner.tick = true | 154 | runner.tick = true |
