aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-04-20 18:20:24 +0200
committerKim Alvefur <zash@zash.se>2020-04-20 18:20:24 +0200
commit7040fbb812f524845c9164732ec4f0957e0318d0 (patch)
tree3ee7d88dccfedf407b54a8e5446993a4aa7b8b53 /spec
parent662a8fda881ecb08c017a0241c145dcd37f3ee0a (diff)
downloadprosody-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')
-rw-r--r--spec/scansion/prosody.cfg.lua11
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