|
|
@ -35,10 +35,13 @@ describe("Readerui module", function()
|
|
|
|
assert(readerui.document == nil)
|
|
|
|
assert(readerui.document == nil)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
it("should not reset running_instance by mistake", function()
|
|
|
|
it("should not reset running_instance by mistake", function()
|
|
|
|
assert.is.truthy(readerui.document)
|
|
|
|
ReaderUI:doShowReader(sample_epub)
|
|
|
|
|
|
|
|
local new_readerui = ReaderUI:_getRunningInstance()
|
|
|
|
|
|
|
|
assert.is.truthy(new_readerui.document)
|
|
|
|
ReaderUI:new{
|
|
|
|
ReaderUI:new{
|
|
|
|
document = DocumentRegistry:openDocument(sample_epub)
|
|
|
|
document = DocumentRegistry:openDocument(sample_epub)
|
|
|
|
}:onClose()
|
|
|
|
}:onClose()
|
|
|
|
assert.is.truthy(readerui.document)
|
|
|
|
assert.is.truthy(new_readerui.document)
|
|
|
|
|
|
|
|
new_readerui:onClose()
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|
end)
|
|
|
|