Software /
code /
prosody
Diff
spec/scansion/prosody.cfg.lua @ 10730:76c9320f69a1
scansion: Mock time libraries during tests
The passage of time does not need test coverage, just look in a mirror.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 20 Apr 2020 18:20:24 +0200 |
parent | 10729:dbce2b94a7eb |
child | 10732:f5d88ad24b30 |
line wrap: on
line diff
--- a/spec/scansion/prosody.cfg.lua Mon Apr 20 18:17:57 2020 +0200 +++ b/spec/scansion/prosody.cfg.lua Mon Apr 20 18:20:24 2020 +0200 @@ -1,5 +1,16 @@ --luacheck: ignore +-- Mock time functions to simplify tests +function _G.os.time() + return 1219439344; +end +package.preload["util.time"] = function () + return { + now = function () return 1219439344.1; end; + monotonic = function () return 0.1; end; + } +end + admins = { "admin@localhost" } use_libevent = true