mirror of
https://github.com/tomgi/git_stats.git
synced 2024-12-22 13:32:17 +01:00
author activity spec
This commit is contained in:
parent
41de85737e
commit
8b4a937372
1 changed files with 32 additions and 0 deletions
|
@ -10,4 +10,36 @@ describe GitStats::GitData::Activity do
|
||||||
tg.commits.map(&:hash).should =~ %w(b3b4f81 d60b5ec ab47ef8 2c11f5e c87ecf9 b621a5d 4e7d0e9 45677ee)
|
tg.commits.map(&:hash).should =~ %w(b3b4f81 d60b5ec ab47ef8 2c11f5e c87ecf9 b621a5d 4e7d0e9 45677ee)
|
||||||
jd.commits.map(&:hash).should =~ %w(fd66657 81e8bef)
|
jd.commits.map(&:hash).should =~ %w(fd66657 81e8bef)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'activity' do
|
||||||
|
it 'should count commits by hour' do
|
||||||
|
tg.activity.by_hour.should == {10 => 4, 12 => 2, 13 => 1, 17 => 1}
|
||||||
|
jd.activity.by_hour.should == {12 => 1, 15 => 1}
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should count commits by day of week' do
|
||||||
|
tg.activity.by_wday.should == {0 => 2, 5 => 5, 6 => 1}
|
||||||
|
jd.activity.by_wday.should == {0 => 1, 3 => 1}
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should count commits by day of week and hour' do
|
||||||
|
tg.activity.by_wday_hour.should == {0 => {12 => 1, 13 => 1}, 5 => {10 => 4, 17 => 1}, 6 => {12 => 1}}
|
||||||
|
jd.activity.by_wday_hour.should == {0 => {12 => 1}, 3 => {15 => 1}}
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should count commits by month' do
|
||||||
|
tg.activity.by_month.should == {10 => 8}
|
||||||
|
jd.activity.by_month.should == {10 => 2}
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should count commits by year' do
|
||||||
|
tg.activity.by_year.should == {2012 => 8}
|
||||||
|
jd.activity.by_year.should == {2012 => 2}
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should count commits by year and month' do
|
||||||
|
tg.activity.by_year_month.should == {2012 => {10 => 8}}
|
||||||
|
jd.activity.by_year_month.should == {2012 => {10 => 2}}
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
Loading…
Reference in a new issue