From 1ef564a4149aebcb9713749b7d3705e4376d697b Mon Sep 17 00:00:00 2001 From: thefosk Date: Wed, 27 May 2015 13:54:31 -0700 Subject: [PATCH] Closes #196 --- spec/unit/tools/timestamp_spec.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/unit/tools/timestamp_spec.lua b/spec/unit/tools/timestamp_spec.lua index dadd817e02d..b4122e04246 100644 --- a/spec/unit/tools/timestamp_spec.lua +++ b/spec/unit/tools/timestamp_spec.lua @@ -35,6 +35,13 @@ describe("Timestamp", function() end) it("should give the same timestamps table for the same time", function() + -- Wait til the beginning of a new second before starting the test + -- to avoid ending up in an edge case when the second is about to end + local now = os.time() + while os.time() < now + 1 do + -- Nothing + end + local timestamps_one = timestamp.get_timestamps() local timestamps_two = timestamp.get_timestamps(timestamp.get_utc()) assert.truthy(timestamps_one)