tests: improve robustness of immediate successes in screen tests

This commit is contained in:
Björn Linse
2017-06-26 14:49:15 +02:00
parent 8fd092f3ff
commit c8810a51a3
20 changed files with 314 additions and 147 deletions

View File

@@ -20,15 +20,15 @@ describe("update_menu notification", function()
end)
local function expect_sent(expected)
screen:wait(function()
screen:expect{condition=function()
if screen.update_menu ~= expected then
if expected then
return 'update_menu was expected but not sent'
error('update_menu was expected but not sent')
else
return 'update_menu was sent unexpectedly'
error('update_menu was sent unexpectedly')
end
end
end)
end, unchanged=(not expected)}
end
it("should be sent when adding a menu", function()