2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00
koreader/spec/unit/imagewidget_spec.lua
2016-04-19 00:01:28 -07:00

24 lines
621 B
Lua

describe("ImageWidget module", function()
local ImageWidget
setup(function()
require("commonrequire")
ImageWidget = require("ui/widget/imagewidget")
end)
it("should render without error", function()
local imgw = ImageWidget:new{
file = "resources/icons/appbar.chevron.up.png"
}
imgw:_render()
assert(imgw._bb)
end)
it("should error out on none exist image", function()
local imgw = ImageWidget:new{
file = "wtf.png"
}
assert.has_error(function()
imgw:_render()
end)
end)
end)