summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/activity_spec.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/activity_spec.lua b/spec/activity_spec.lua
index 197b57f..581b0ba 100644
--- a/spec/activity_spec.lua
+++ b/spec/activity_spec.lua
@@ -32,6 +32,16 @@ Fri 0000000000000000000000000000000000000000000000000000_
0000000000000000000000000000000000000000000000000000_
]]
+local ROLL = [[
+ 00000000000000000000000000000000000000000000000000000
+Mon 00000000000000000000000000000000000000000000000000000
+ 00000000000000000000000000000000000000000000000000000
+Wed 00000000000000000000000000000000000000000000000000000
+ 00000000000000000000000000000000000000000000000000000
+Fri 0000000000000000000000000000000000000000000000000000_
+ 0000000000000000000000000000000000000000000000000000_
+]]
+
describe("Generator", function()
describe("shall generate correct table for year", function()
@@ -66,4 +76,9 @@ describe("Generator", function()
assert.are.equal(Y2024:gsub("0", "1"), activity.generate_table(2024, lookup, plain))
end)
end)
+
+ it("shall support generating rolling table", function()
+ local date = os.date("*t", os.time{year=2024, month=2, day=8})
+ assert.are.equal(ROLL, activity.generate_table("rolling", lookup, plain, date))
+ end)
end)