diff --git a/.ci/install.sh b/.ci/install.sh index f43812d03..b3bef371b 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -18,7 +18,8 @@ travis_retry luarocks --local install luafilesystem # for verbose_print module travis_retry luarocks --local install ansicolors travis_retry luarocks --local install busted 2.0.rc11-0 -#- travis_retry luarocks --local install busted 1.11.1-1 +travis_retry luarocks --local remove lua_cliargs --force +travis_retry luarocks --local install lua_cliargs 2.5-5 --force #- mv -f $HOME/.luarocks/bin/busted_bootstrap $HOME/.luarocks/bin/busted travis_retry luarocks --local install luacov # luasec doesn't automatically detect 64-bit libs diff --git a/plugins/kosync.koplugin/main.lua b/plugins/kosync.koplugin/main.lua index 1d3345a4c..aa1548917 100644 --- a/plugins/kosync.koplugin/main.lua +++ b/plugins/kosync.koplugin/main.lua @@ -13,6 +13,11 @@ local DEBUG = require("dbg") local T = require("ffi/util").template local _ = require("gettext") local md5 = require("ffi/MD5") +local random = require("random") + +if not G_reader_settings:readSetting("device_id") then + G_reader_settings:saveSetting("device_id", random.uuid()) +end local KOSync = InputContainer:new{ name = "kosync", @@ -26,7 +31,7 @@ function KOSync:init() self.kosync_userkey = settings.userkey self.kosync_auto_sync = not (settings.auto_sync == false) self.kosync_device_id = G_reader_settings:readSetting("device_id") - assert(self.kosync_device_id) + --assert(self.kosync_device_id) self.ui:registerPostInitCallback(function() if self.kosync_auto_sync then UIManager:scheduleIn(1, function() self:getProgress() end) diff --git a/reader.lua b/reader.lua index eb3177475..ffe5adb82 100755 --- a/reader.lua +++ b/reader.lua @@ -96,11 +96,6 @@ local lfs = require("libs/libkoreader-lfs") local UIManager = require("ui/uimanager") local Device = require("device") local Font = require("ui/font") -local random = require("random") - -if not G_reader_settings:readSetting("device_id") then - G_reader_settings:saveSetting("device_id", random.uuid()) -end -- read some global reader setting here: -- font diff --git a/spec/unit/device_spec.lua b/spec/unit/device_spec.lua index c45013008..fb2280606 100644 --- a/spec/unit/device_spec.lua +++ b/spec/unit/device_spec.lua @@ -194,8 +194,8 @@ describe("device module", function() end) end) - describe("kindle", function() - it("should initialize voyager without error", function() + describe("kindle #notest #nocov", function() + it("should initialize voyage without error", function() package.loaded['ffi/framebuffer_mxcfb'] = mock_fb stub(io, "open") io.open.returns({ diff --git a/spec/unit/readerrolling_spec.lua b/spec/unit/readerrolling_spec.lua index 9572997ce..5e382e837 100644 --- a/spec/unit/readerrolling_spec.lua +++ b/spec/unit/readerrolling_spec.lua @@ -156,6 +156,9 @@ describe("Readerrolling module", function() end) describe("switching screen mode should not change current page number", function() + teardown(function() + readerui:handleEvent(Event:new("ChangeScreenMode", "portrait")) + end) it("for portrait-landscape-portrait switching", function() for i = 80, 100, 10 do readerui:handleEvent(Event:new("ChangeScreenMode", "portrait")) diff --git a/spec/unit/screenshoter_spec.lua b/spec/unit/screenshoter_spec.lua index 1e6d0b4bd..2cab78dce 100644 --- a/spec/unit/screenshoter_spec.lua +++ b/spec/unit/screenshoter_spec.lua @@ -16,6 +16,10 @@ describe("ReaderScreenshot module", function() } end) + teardown(function() + readerui:handleEvent(Event:new("ChangeScreenMode", "portrait")) + end) + it("should get screenshot in portrait", function() local name = "screenshots/reader_screenshot_portrait.png" readerui:handleEvent(Event:new("ChangeScreenMode", "portrait"))