summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2024-02-09 21:56:33 +0100
committerAki <please@ignore.pl>2024-02-09 21:56:33 +0100
commit9b1f5d2b5554c0ff9f355866d4669b3ffcaa3686 (patch)
tree3e04f1f09244e712e61220baae8857ec21906111 /spec
parentd41c7d0e1d864bec20cd917354fe82330d0781d5 (diff)
downloadactivity-9b1f5d2b5554c0ff9f355866d4669b3ffcaa3686.zip
activity-9b1f5d2b5554c0ff9f355866d4669b3ffcaa3686.tar.gz
activity-9b1f5d2b5554c0ff9f355866d4669b3ffcaa3686.tar.bz2
Moved the standalone activity.lua into activity.generators
Diffstat (limited to 'spec')
-rw-r--r--spec/generators_spec.lua (renamed from spec/activity_spec.lua)16
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/activity_spec.lua b/spec/generators_spec.lua
index 38338e8..a6c1e9a 100644
--- a/spec/activity_spec.lua
+++ b/spec/generators_spec.lua
@@ -1,5 +1,5 @@
-local activity = require "activity"
local dates = require "activity.dates"
+local generators = require "activity.generators"
local plain = require "activity.formats.plain"
local Y2024 = [[
@@ -52,15 +52,15 @@ end
describe("Yearly chart generator", function()
describe("shall generate empty table for year", function()
it("2024", function()
- assert.are.equal(Y2024, activity.generate_table(2024, always_zero, plain))
+ assert.are.equal(Y2024, generators.generate_table(2024, always_zero, plain))
end)
it("2023", function()
- assert.are.equal(Y2023, activity.generate_table(2023, always_zero, plain))
+ assert.are.equal(Y2023, generators.generate_table(2023, always_zero, plain))
end)
it("2020", function()
- assert.are.equal(Y2020, activity.generate_table(2020, always_zero, plain))
+ assert.are.equal(Y2020, generators.generate_table(2020, always_zero, plain))
end)
end)
@@ -74,11 +74,11 @@ describe("Yearly chart generator", function()
end
it("regular years", function()
- assert.are.equal(Y2023:gsub("0", "1"), activity.generate_table(2023, lookup, plain))
+ assert.are.equal(Y2023:gsub("0", "1"), generators.generate_table(2023, lookup, plain))
end)
it("leap years", function()
- assert.are.equal(Y2024:gsub("0", "1"), activity.generate_table(2024, lookup, plain))
+ assert.are.equal(Y2024:gsub("0", "1"), generators.generate_table(2024, lookup, plain))
end)
end)
end)
@@ -87,7 +87,7 @@ end)
describe("Rolling chart generator", function()
it("shall generate empty table", function()
local date = os.date("*t", os.time{year=2024, month=2, day=8})
- assert.are.equal(ROLL, activity.generate_table("rolling", always_zero, plain, date))
+ assert.are.equal(ROLL, generators.generate_table("rolling", always_zero, plain, date))
end)
it("shall put activity into cells", function()
@@ -103,6 +103,6 @@ describe("Rolling chart generator", function()
return 0
end
- assert.are.equal(ROLL:gsub("0", "1"), activity.generate_table("rolling", lookup, plain, date))
+ assert.are.equal(ROLL:gsub("0", "1"), generators.generate_table("rolling", lookup, plain, date))
end)
end)