mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
Tests: Have only one place for stubbing widgets
This makes the tests for wibox.hierarchy use test_utils.widget_stub() instead of having its own implementation of "fake widgets". Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
45323f2801
commit
447492e986
2 changed files with 5 additions and 5 deletions
|
@ -8,12 +8,10 @@ local hierarchy = require("wibox.hierarchy")
|
|||
local cairo = require("lgi").cairo
|
||||
local matrix = require("gears.matrix")
|
||||
local object = require("gears.object")
|
||||
local utils = require("wibox.test_utils")
|
||||
|
||||
local function make_widget(children)
|
||||
local result = object()
|
||||
result:add_signal("widget::redraw_needed")
|
||||
result:add_signal("widget::layout_changed")
|
||||
result.visible = true
|
||||
local result = utils.widget_stub()
|
||||
result.layout = function()
|
||||
return children
|
||||
end
|
||||
|
|
|
@ -82,8 +82,10 @@ assert:register("assertion", "widget_layout", widget_layout, "assertion.widget_l
|
|||
return {
|
||||
widget_stub = function(width, height)
|
||||
local w = object()
|
||||
w:add_signal("widget::redraw_needed")
|
||||
w:add_signal("widget::layout_changed")
|
||||
w.visible = true
|
||||
|
||||
w.opacity = 1
|
||||
w.fit = function()
|
||||
return width or 10, height or 10
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue