Skip to content

Commit d7ff38d

Browse files
committed
chore: cover year and all-time aggregate strategies with tests
1 parent 9068c24 commit d7ff38d

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

specs/aggregate.feature

+25-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Feature: Aggregate class is an abstract class to keep summary of a repository st
1515
When I call listFiles method
1616
Then I get an empty list in response
1717

18-
Scenario: commits of type modify should aggregate data for a file-key
18+
Scenario: commits of type modify should aggregate data for a file-key (year-quarter)
1919
Given I use a TestAggregate class
2020
When I use a 'year-quarter' strategy
2121
And I add commit of type 'modify' with filename 'src/file-1' and commite date '2023-05-04'
@@ -25,4 +25,28 @@ Feature: Aggregate class is an abstract class to keep summary of a repository st
2525
When I call listAggregates method for 'src/file-1'
2626
Then I get a list with 1 value in response
2727
When I call getValue method for 'src/file-1' and '2023-Q2'
28+
Then I get a number with value 4 in response
29+
30+
Scenario: commits of type modify should aggregate data for a file-key (year)
31+
Given I use a TestAggregate class
32+
When I use a 'year' strategy
33+
And I add commit of type 'modify' with filename 'src/file-1' and commite date '2023-05-04'
34+
And I add commit of type 'modify' with filename 'src/file-1' and commite date '2023-05-03'
35+
And I add commit of type 'modify' with filename 'src/file-1' and commite date '2023-05-02'
36+
And I add commit of type 'modify' with filename 'src/file-1' and commite date '2023-05-01'
37+
When I call listAggregates method for 'src/file-1'
38+
Then I get a list with 1 value in response
39+
When I call getValue method for 'src/file-1' and '2023'
40+
Then I get a number with value 4 in response
41+
42+
Scenario: commits of type modify should aggregate data for a file-key (all-time)
43+
Given I use a TestAggregate class
44+
When I use a 'all-time' strategy
45+
And I add commit of type 'modify' with filename 'src/file-1' and commite date '2022-05-04'
46+
And I add commit of type 'modify' with filename 'src/file-1' and commite date '2023-05-03'
47+
And I add commit of type 'modify' with filename 'src/file-1' and commite date '2024-05-02'
48+
And I add commit of type 'modify' with filename 'src/file-1' and commite date '2025-05-01'
49+
When I call listAggregates method for 'src/file-1'
50+
Then I get a list with 1 value in response
51+
When I call getValue method for 'src/file-1' and 'all-time'
2852
Then I get a number with value 4 in response

0 commit comments

Comments
 (0)