diff options
author | Kim Alvefur <zash@zash.se> | 2020-04-20 18:20:24 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-04-20 18:20:24 +0200 |
commit | 7040fbb812f524845c9164732ec4f0957e0318d0 (patch) | |
tree | 3ee7d88dccfedf407b54a8e5446993a4aa7b8b53 /spec/scansion/prosody.cfg.lua | |
parent | 662a8fda881ecb08c017a0241c145dcd37f3ee0a (diff) | |
download | prosody-7040fbb812f524845c9164732ec4f0957e0318d0.tar.gz prosody-7040fbb812f524845c9164732ec4f0957e0318d0.zip |
scansion: Mock time libraries during tests
The passage of time does not need test coverage, just look in a mirror.
Diffstat (limited to 'spec/scansion/prosody.cfg.lua')
-rw-r--r-- | spec/scansion/prosody.cfg.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/scansion/prosody.cfg.lua b/spec/scansion/prosody.cfg.lua index d7444e7a..88a5e0c9 100644 --- a/spec/scansion/prosody.cfg.lua +++ b/spec/scansion/prosody.cfg.lua @@ -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 |