Travis: run luacheck on unit tests (#3059)

* Travis: run luacheck on unit tests
This commit is contained in:
Frans de Jonge
2017-08-08 22:35:40 +02:00
committed by Hzj_jie
parent 1bfad22af0
commit e3c17aa6d0
36 changed files with 86 additions and 87 deletions

View File

@@ -51,15 +51,13 @@ local service = [[
]]
describe("KOSync modules #notest #nocov", function()
local UIManager, logger, md5, client
local logger, md5, client
local username, password, doc, percentage, progress, device
setup(function()
require("commonrequire")
UIManager = require("ui/uimanager")
logger = require("logger")
md5 = require("ffi/MD5")
local HTTPClient = require("httpclient")
local Spore = require("Spore")
client = Spore.new_from_string(service)
package.loaded['Spore.Middleware.GinClient'] = {}
@@ -188,13 +186,13 @@ describe("KOSync modules #notest #nocov", function()
}
-- TODO: Test kosync module
local function mockKOSyncClient()
local function mockKOSyncClient() --luacheck: ignore
package.loaded["KOSyncClient"] = nil
local c = require("KOSyncClient")
c.new = function(o)
local o = o or {}
setmetatable(o, self)
self.__index = self
o = o or {}
setmetatable(o, self) --luacheck: ignore
self.__index = self --luacheck: ignore
return o
end
@@ -208,11 +206,11 @@ describe("KOSync modules #notest #nocov", function()
return res.result, res.body
end
c.update_progress = function(name, passwd, doc, prog, percent, device, device_id, cb)
c.update_progress = function(name, passwd, doc, prog, percent, device, device_id, cb) --luacheck: ignore
cb(res.result, res.body)
end
c.get_progress = function(name, passwd, doc, cb)
c.get_progress = function(name, passwd, doc, cb) --luacheck: ignore
cb(res.result, res.body)
end
end