diff options
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) | ||