diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2024-02-26 18:30:31 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2024-02-27 13:28:33 -0300 |
commit | 03e401231972d7b4db0145a71ce74d5d18d1a901 (patch) | |
tree | 10e59cd4fe0065ec87db0699965bb5e2f0436d74 /spec/build_spec.lua | |
parent | 5b2e63e6b087bdf626dd7cef319d6ba29f5e197c (diff) | |
download | luarocks-03e401231972d7b4db0145a71ce74d5d18d1a901.tar.gz luarocks-03e401231972d7b4db0145a71ce74d5d18d1a901.tar.bz2 luarocks-03e401231972d7b4db0145a71ce74d5d18d1a901.zip |
tests: reorganize and speed up unit tests
Diffstat (limited to 'spec/build_spec.lua')
-rw-r--r-- | spec/build_spec.lua | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua index a2c09119..d07447c1 100644 --- a/spec/build_spec.lua +++ b/spec/build_spec.lua | |||
@@ -6,9 +6,7 @@ local testing_paths = test_env.testing_paths | |||
6 | local write_file = test_env.write_file | 6 | local write_file = test_env.write_file |
7 | local git_repo = require("spec.util.git_repo") | 7 | local git_repo = require("spec.util.git_repo") |
8 | 8 | ||
9 | test_env.unload_luarocks() | 9 | local cfg, fs |
10 | local cfg = require("luarocks.core.cfg") | ||
11 | local fs = require("luarocks.fs") | ||
12 | 10 | ||
13 | local extra_rocks = { | 11 | local extra_rocks = { |
14 | "/lmathx-20120430.51-1.src.rock", | 12 | "/lmathx-20120430.51-1.src.rock", |
@@ -40,13 +38,12 @@ local c_module_source = [[ | |||
40 | ]] | 38 | ]] |
41 | 39 | ||
42 | describe("LuaRocks build #integration", function() | 40 | describe("LuaRocks build #integration", function() |
43 | lazy_setup(function() | ||
44 | cfg.init() | ||
45 | fs.init() | ||
46 | end) | ||
47 | |||
48 | before_each(function() | 41 | before_each(function() |
49 | test_env.setup_specs(extra_rocks) | 42 | test_env.setup_specs(extra_rocks) |
43 | cfg = require("luarocks.core.cfg") | ||
44 | fs = require("luarocks.fs") | ||
45 | cfg.init() | ||
46 | fs.init() | ||
50 | end) | 47 | end) |
51 | 48 | ||
52 | describe("building with flags", function() | 49 | describe("building with flags", function() |
@@ -154,7 +151,7 @@ describe("LuaRocks build #integration", function() | |||
154 | 151 | ||
155 | assert.is_true(run.luarocks_bool("build test-1.0-1.rockspec --deps-mode=none")) | 152 | assert.is_true(run.luarocks_bool("build test-1.0-1.rockspec --deps-mode=none")) |
156 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/test/1.0-1/test-1.0-1.rockspec")) | 153 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/test/1.0-1/test-1.0-1.rockspec")) |
157 | end) | 154 | end, finally) |
158 | end) | 155 | end) |
159 | 156 | ||
160 | it("supports --pin #pinning", function() | 157 | it("supports --pin #pinning", function() |
@@ -459,6 +456,7 @@ describe("LuaRocks build #integration", function() | |||
459 | 456 | ||
460 | describe("#mock external dependencies", function() | 457 | describe("#mock external dependencies", function() |
461 | lazy_setup(function() | 458 | lazy_setup(function() |
459 | test_env.setup_specs(nil, "mock") | ||
462 | test_env.mock_server_init() | 460 | test_env.mock_server_init() |
463 | end) | 461 | end) |
464 | 462 | ||