Added the concept of a clock to Cron.

This commit is contained in:
Per Malmberg
2018-03-11 20:09:06 +01:00
parent be2b4424a1
commit 74e1ad4d60
7 changed files with 49 additions and 12 deletions

View File

@@ -44,7 +44,7 @@ SCENARIO("Adding a task")
THEN("Count is 1 and task was not expired two seconds ago")
{
REQUIRE(c.count() == 1);
c.execute_expired_tasks(system_clock::now() - 2s);
c.execute_expired_tasks(c.get_clock()->now() - 2s);
REQUIRE_FALSE(expired);
}
AND_THEN("Task is expired when calculating based on current time")