diff options
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) |