mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-13 19:50:31 +00:00
parent
ce1f14a010
commit
17645a79f0
@ -336,7 +336,7 @@ githubRelease {
|
|||||||
token project.hasProperty('githubApiKey') ? project.githubApiKey : ''
|
token project.hasProperty('githubApiKey') ? project.githubApiKey : ''
|
||||||
owner 'SquidDev-CC'
|
owner 'SquidDev-CC'
|
||||||
repo 'CC-Tweaked'
|
repo 'CC-Tweaked'
|
||||||
targetCommitish { Grgit.open(dir: '.').branch.current().fullName }
|
targetCommitish { Grgit.open(dir: '.').branch.current().name }
|
||||||
|
|
||||||
tagName "v${mc_version}-${mod_version}"
|
tagName "v${mc_version}-${mod_version}"
|
||||||
releaseName "[${mc_version}] ${mod_version}"
|
releaseName "[${mc_version}] ${mod_version}"
|
||||||
@ -349,10 +349,12 @@ githubRelease {
|
|||||||
prerelease false
|
prerelease false
|
||||||
}
|
}
|
||||||
|
|
||||||
task uploadAll(dependsOn: [uploadArchives, "curseforge", "githubRelease"]) {
|
def uploadTasks = ["uploadArchives", "curseforge", "githubRelease"]
|
||||||
|
uploadTasks.forEach { tasks.getByName(it).dependsOn checkRelease }
|
||||||
|
|
||||||
|
task uploadAll(dependsOn: uploadTasks) {
|
||||||
group "upload"
|
group "upload"
|
||||||
description "Uploads to all repositories (Maven, Curse, GitHub release)"
|
description "Uploads to all repositories (Maven, Curse, GitHub release)"
|
||||||
dependsOn checkRelease
|
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
|
@ -153,7 +153,7 @@ end
|
|||||||
|
|
||||||
function lookup( sProtocol, sHostname )
|
function lookup( sProtocol, sHostname )
|
||||||
expect(1, sProtocol, "string")
|
expect(1, sProtocol, "string")
|
||||||
expect(2, sHostname, "string")
|
expect(2, sHostname, "string", "nil")
|
||||||
|
|
||||||
-- Build list of host IDs
|
-- Build list of host IDs
|
||||||
local tResults = nil
|
local tResults = nil
|
||||||
|
@ -33,11 +33,8 @@ local active_stubs = {}
|
|||||||
--
|
--
|
||||||
-- @tparam string var The variable to stub
|
-- @tparam string var The variable to stub
|
||||||
-- @param value The value to stub it with
|
-- @param value The value to stub it with
|
||||||
local function stub(var, value)
|
local function stub(tbl, var, value)
|
||||||
if not active_stubs[var] then
|
table.insert(active_stubs, { tbl = tbl, var = var, value = tbl[var] })
|
||||||
active_stubs[var] = { value = _G[var] }
|
|
||||||
end
|
|
||||||
|
|
||||||
_G[var] = value
|
_G[var] = value
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -56,7 +53,11 @@ end
|
|||||||
|
|
||||||
--- Restore the global state of the computer to a previous version
|
--- Restore the global state of the computer to a previous version
|
||||||
local function pop_state(state)
|
local function pop_state(state)
|
||||||
for k, v in pairs(active_stubs) do _G[k] = v.value end
|
for i = #active_stubs, 1, -1 do
|
||||||
|
local stub = active_stubs[i]
|
||||||
|
stub.tbl[stub.var] = stub.value
|
||||||
|
end
|
||||||
|
|
||||||
active_stubs = state.stubs
|
active_stubs = state.stubs
|
||||||
|
|
||||||
term.redirect(state.term)
|
term.redirect(state.term)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
describe("The gps library", function()
|
describe("The gps library", function()
|
||||||
describe("gps.locate", function()
|
describe("gps.locate", function()
|
||||||
it("validates arguments", function()
|
it("validates arguments", function()
|
||||||
stub("commands", { getBlockPosition = function()
|
stub(_G, "commands", { getBlockPosition = function()
|
||||||
end })
|
end })
|
||||||
|
|
||||||
gps.locate()
|
gps.locate()
|
||||||
|
@ -74,5 +74,13 @@ describe("The rednet library", function()
|
|||||||
expect.error(rednet.lookup, nil):eq("bad argument #1 (expected string, got nil)")
|
expect.error(rednet.lookup, nil):eq("bad argument #1 (expected string, got nil)")
|
||||||
expect.error(rednet.lookup, "", false):eq("bad argument #2 (expected string, got boolean)")
|
expect.error(rednet.lookup, "", false):eq("bad argument #2 (expected string, got boolean)")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it("gets a locally hosted protocol", function()
|
||||||
|
rednet.host("a_protocol", "a_hostname")
|
||||||
|
|
||||||
|
expect(rednet.lookup("a_protocol")):eq(os.getComputerID())
|
||||||
|
expect(rednet.lookup("a_protocol", "localhost")):eq(os.getComputerID())
|
||||||
|
expect(rednet.lookup("a_protocol", "a_hostname")):eq(os.getComputerID())
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user