blob: cba80a3e709b5a3467f18ee0c13e60f69da44f5a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
local test_env = require("test/test_environment")
local lfs = require("lfs")
test_env.unload_luarocks()
local lint = require("luarocks.lint")
local extra_rocks = {
"/validate-args-1.5.4-1.rockspec"
}
expose("LuaRocks lint tests #blackbox #b_lint", function()
before_each(function()
test_env.setup_specs(extra_rocks)
testing_paths = test_env.testing_paths
run = test_env.run
end)
it("LuaRocks lint with no flags/arguments", function()
assert.is_false(run.luarocks_bool("lint"))
end)
it("LuaRocks lint invalid argument", function()
assert.is_false(run.luarocks_bool("lint invalid"))
end)
it("LuaRocks lint OK", function()
assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1"))
local output = run.luarocks("lint validate-args-1.5.4-1.rockspec")
assert.are.same(output, "")
assert.is_true(os.remove("validate-args-1.5.4-1.rockspec"))
end)
describe("LuaRocks lint mismatch set", function()
it("LuaRocks lint mismatch string", function()
assert.is_false(run.luarocks_bool("lint " .. testing_paths.testing_dir .. "/testfiles/type_mismatch_string-1.0-1.rockspec"))
end)
it("LuaRocks lint mismatch version", function()
assert.is_false(run.luarocks_bool("lint " .. testing_paths.testing_dir .. "/testfiles/type_mismatch_version-1.0-1.rockspec"))
end)
it("LuaRocks lint mismatch table", function()
assert.is_false(run.luarocks_bool("lint " .. testing_paths.testing_dir .. "/testfiles/type_mismatch_table-1.0-1.rockspec"))
end)
it("LuaRocks lint mismatch no build table", function()
assert.is_false(run.luarocks_bool("lint " .. testing_paths.testing_dir .. "/testfiles/no_build_table-1.0-1.rockspec"))
end)
end)
end)
|