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/unit/loader_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/unit/loader_spec.lua')
| -rw-r--r-- | spec/unit/loader_spec.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/unit/loader_spec.lua b/spec/unit/loader_spec.lua new file mode 100644 index 00000000..7650c80c --- /dev/null +++ b/spec/unit/loader_spec.lua | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | local test_env = require("spec.util.test_env") | ||
| 2 | local run = test_env.run | ||
| 3 | |||
| 4 | describe("luarocks.loader", function() | ||
| 5 | |||
| 6 | before_each(function() | ||
| 7 | test_env.setup_specs() | ||
| 8 | end) | ||
| 9 | |||
| 10 | describe("#unit", function() | ||
| 11 | it("starts", function() | ||
| 12 | assert(run.lua_bool([[-e "require 'luarocks.loader'; print(package.loaded['luarocks.loaded'])"]])) | ||
| 13 | end) | ||
| 14 | |||
| 15 | describe("which", function() | ||
| 16 | it("finds modules using package.path", function() | ||
| 17 | assert(run.lua_bool([[-e "loader = require 'luarocks.loader'; local x,y,z,p = loader.which('luarocks.loader', 'p'); assert(p == 'p')"]])) | ||
| 18 | end) | ||
| 19 | end) | ||
| 20 | end) | ||
| 21 | end) | ||
