git_stats/spec/integration/activity_spec.rb

34 lines
880 B
Ruby
Raw Normal View History

2012-10-23 20:37:42 +02:00
# -*- encoding : utf-8 -*-
2012-10-21 22:41:54 +02:00
require 'integration/shared'
2012-10-19 18:17:36 +02:00
describe GitStats::GitData::Activity do
2012-10-21 22:41:54 +02:00
include_context "shared"
2012-10-19 18:17:36 +02:00
let(:activity) { repo.activity }
it 'should count commits by hour' do
activity.by_hour.should == {10 => 4, 12 => 3, 13 => 1, 15 => 1, 17 => 1}
end
it 'should count commits by day of week' do
activity.by_wday.should == {0 => 3, 3 => 1, 5 => 5, 6 => 1}
end
it 'should count commits by day of week and hour' do
activity.by_wday_hour.should == {0 => {12 => 2, 13 => 1}, 3 => {15 => 1}, 5 => {10 => 4, 17 => 1}, 6 => {12 => 1}}
end
it 'should count commits by month' do
activity.by_month.should == {10 => 10}
end
it 'should count commits by year' do
activity.by_year.should == {2012 => 10}
end
it 'should count commits by year and month' do
activity.by_year_month.should == {2012 => {10 => 10}}
end
2012-10-23 20:37:42 +02:00
end