diff --git a/lib/wibox/widget/base.lua b/lib/wibox/widget/base.lua index 6a7808ce5..561e446b6 100644 --- a/lib/wibox/widget/base.lua +++ b/lib/wibox/widget/base.lua @@ -559,7 +559,8 @@ end --- Do some sanity checking on widget. This function raises a lua error if -- widget is not a valid widget. function base.check_widget(widget) - assert(type(widget) == "table") + assert(type(widget) == "table", "Type should be table, but is " .. tostring(type(widget))) + assert(widget.is_widget, "Argument is not a widget!") for _, func in pairs({ "add_signal", "connect_signal", "disconnect_signal" }) do assert(type(widget[func]) == "function", func .. " is not a function") end diff --git a/spec/wibox/test_utils.lua b/spec/wibox/test_utils.lua index a557df76c..04e6e0f13 100644 --- a/spec/wibox/test_utils.lua +++ b/spec/wibox/test_utils.lua @@ -84,6 +84,7 @@ return { local w = object() w:add_signal("widget::redraw_needed") w:add_signal("widget::layout_changed") + w.is_widget = true w.visible = true w.opacity = 1 if width or height then