mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-06-25 22:53:22 +00:00
![JakobDev](/assets/img/avatar_default.png)
I'm not entirely sure how useful all of these will be yet - still trying to work out what/when to test things, but hopefully this'll be a useful datapoint.
15 lines
603 B
Lua
15 lines
603 B
Lua
local capture = require "test_helpers".capture_program
|
|
|
|
describe("The programs program", function()
|
|
it("list programs", function()
|
|
local programs = stub(shell, "programs", function() return { "some", "programs" } end)
|
|
local pagedTabulate = stub(textutils, "pagedTabulate", function(x) print(table.unpack(x)) end)
|
|
|
|
expect(capture(stub, "/rom/programs/programs.lua"))
|
|
:matches { ok = true, output = "some programs\n", error = "" }
|
|
|
|
expect(programs):called_with(false)
|
|
expect(pagedTabulate):called_with_matching({ "some", "programs" })
|
|
end)
|
|
end)
|