From 30f791386bf8ea375648bf13b7b2171a0f219941 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 17 Dec 2023 16:29:03 +0100 Subject: scansion: Use captures or wildcards instead of mocking time > Mockery is one of the things I hold dear! And he's making a mockery of it!! -- Belkar Bitterleaf --- spec/scansion/extdisco.scs | 8 ++++---- spec/scansion/lastactivity.scs | 2 +- spec/scansion/mam_extended.scs | 16 ++++++++-------- spec/scansion/prosody.cfg.lua | 10 ---------- spec/scansion/uptime.scs | 2 +- 5 files changed, 14 insertions(+), 24 deletions(-) diff --git a/spec/scansion/extdisco.scs b/spec/scansion/extdisco.scs index f0781dc5..f2c8139f 100644 --- a/spec/scansion/extdisco.scs +++ b/spec/scansion/extdisco.scs @@ -17,8 +17,8 @@ Romeo receives: - - + + @@ -47,8 +47,8 @@ Romeo sends: Romeo receives: - - + + diff --git a/spec/scansion/lastactivity.scs b/spec/scansion/lastactivity.scs index 44f4e516..4b8c8573 100644 --- a/spec/scansion/lastactivity.scs +++ b/spec/scansion/lastactivity.scs @@ -37,7 +37,7 @@ Romeo sends: Romeo receives: - Goodbye + Goodbye Romeo disconnects diff --git a/spec/scansion/mam_extended.scs b/spec/scansion/mam_extended.scs index 70897737..e79eba95 100644 --- a/spec/scansion/mam_extended.scs +++ b/spec/scansion/mam_extended.scs @@ -45,8 +45,8 @@ Romeo sends: Romeo receives: - - + + @@ -57,9 +57,9 @@ Romeo sends: Romeo receives: - + - + Hello @@ -69,9 +69,9 @@ Romeo receives: Romeo receives: - + - + U there? @@ -98,7 +98,7 @@ Romeo receives: - + U there? @@ -110,7 +110,7 @@ Romeo receives: - + Hello diff --git a/spec/scansion/prosody.cfg.lua b/spec/scansion/prosody.cfg.lua index 0061635d..f090296a 100644 --- a/spec/scansion/prosody.cfg.lua +++ b/spec/scansion/prosody.cfg.lua @@ -1,15 +1,5 @@ --luacheck: ignore --- Mock time functions to simplify tests -- -local time = require "util.time"; -function _G.os.time() - return 1219439344; -end -function time.now() - return 1219439344.5; -end -------------------------------------------- - admins = { "admin@localhost" } network_backend = ENV_PROSODY_NETWORK_BACKEND or "epoll" diff --git a/spec/scansion/uptime.scs b/spec/scansion/uptime.scs index 188b9eb5..ed83e51b 100644 --- a/spec/scansion/uptime.scs +++ b/spec/scansion/uptime.scs @@ -15,7 +15,7 @@ Romeo sends: Romeo receives: - + Romeo disconnects -- cgit v1.2.3