oh, and an example of some testing (something I made in the game GreyHack):
TEST "File manager returns an error if the file cannot be created", function()
mockComputer = Mock.build(get_shell.host_computer)
mockComputer.expectCall("File").withParams(["bar/foo.txt"]).andReturn(null)
mockComputer.expectCall("touch").withParams(["bar", "foo.txt"])
mockComputer.expectCall("File").withParams(["bar/foo.txt"]).andReturn(null)
file = FSManager.openOrCreate("foo.txt", "bar", mockComputer)
expectTrue file isa Error.INVALID_FILE_HANDLE
expectTrue mockComputer.getResult
end function