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.
17 lines
597 B
Lua
17 lines
597 B
Lua
local capture = require "test_helpers".capture_program
|
|
|
|
describe("The drive program", function()
|
|
it("run the program", function()
|
|
local getFreeSpace = stub(fs, "getFreeSpace", function() return 1234e4 end)
|
|
|
|
expect(capture(stub, "drive"))
|
|
:matches { ok = true, output = "hdd (12.3MB remaining)\n", error = "" }
|
|
expect(getFreeSpace):called(1):called_with("")
|
|
end)
|
|
|
|
it("fails on a non-existent path", function()
|
|
expect(capture(stub, "drive /rom/nothing"))
|
|
:matches { ok = true, output = "No such path\n", error = "" }
|
|
end)
|
|
end)
|