• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nightconcept / almandine / 14715174283

28 Apr 2025 06:32PM UTC coverage: 37.748%. First build
14715174283

push

github

web-flow
Merge 789647aa5 into 78f97e22e

477 of 566 new or added lines in 14 files covered. (84.28%)

1693 of 4485 relevant lines covered (37.75%)

11.33 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.5
/src/spec/install_spec.lua
1
--[[
2
  Install Module Specification
3

4
  Busted test suite for install_dependencies in src/modules/install.lua.
5
  - Verifies correct installation of dependencies from manifest.
6
  - Ensures manifest is not modified and only manifest dependencies are installed.
7
]]--
8

9
-- luacheck: globals describe it assert
10

11
--- Install module specification for Busted.
12
-- @module install_spec
13

14
describe("install_module.install_dependencies", function()
2✔
15
  local install = require("modules.install")
1✔
16
  local install_dependencies = install.install_dependencies
1✔
17

18
  local function make_manifest(deps)
19
    local manifest = { dependencies = deps or {} }
2✔
20
    return function() return manifest, nil end
4✔
21
  end
22

23
  local function ensure_lib_dir() end
3✔
24

25
  local function make_downloader()
26
    local downloads = {}
2✔
27
    return {
2✔
28
      download = function(url, out_path)
29
        table.insert(downloads, {url=url, out_path=out_path})
3✔
30
        if url and out_path then return true end
3✔
NEW
31
        return false, "invalid args"
×
32
      end,
33
      get_downloads = function() return downloads end
4✔
34
    }
2✔
35
  end
36

37
  it("installs all dependencies from manifest", function()
2✔
38
    local deps = {
1✔
39
      foo = "https://example.com/foo.lua",
1✔
40
      bar = { url = "https://example.com/bar.lua", path = "custom/bar.lua" }
1✔
41
    }
42
    local load = make_manifest(deps)
1✔
43
    local downloader = make_downloader()
1✔
44
    local utils = {downloader = downloader}
1✔
45
    install_dependencies(nil, load, ensure_lib_dir, downloader, utils)
1✔
46
    local downloads = downloader.get_downloads()
1✔
47
    assert.are.equal(#downloads, 2)
1✔
48
    local found_foo, found_bar, found_custom = false, false, false
1✔
49
    for _, d in ipairs(downloads) do
3✔
50
      if d.url == "https://example.com/foo.lua" then found_foo = true end
2✔
51
      if d.url == "https://example.com/bar.lua" then found_bar = true end
2✔
52
      if d.out_path == "custom/bar.lua" then found_custom = true end
2✔
53
    end
54
    assert.is_true(found_foo and found_bar and found_custom)
1✔
55
  end)
56

57
  it("installs only the specified dependency", function()
2✔
58
    local deps = {
1✔
59
      foo = "https://example.com/foo.lua",
1✔
60
      bar = "https://example.com/bar.lua"
1✔
61
    }
62
    local load = make_manifest(deps)
1✔
63
    local downloader = make_downloader()
1✔
64
    local utils = {downloader = downloader}
1✔
65
    install_dependencies("foo", load, ensure_lib_dir, downloader, utils)
1✔
66
    local downloads = downloader.get_downloads()
1✔
67
    assert.are.equal(#downloads, 1)
1✔
68
    assert.are.equal(downloads[1].url, "https://example.com/foo.lua")
1✔
69
  end)
70
end)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc