Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-04-16 17:39:48 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-04-16 17:39:48 +0400
commit211c433cd89ddc49b1f8c3ef6ba7bc366428a851 (patch)
treebe2c081b0632419489149b2f21f90cda9b60dd24 /spec/lib
parentbe41d0e1bfb61abeb12c33c2344e374adc7803cf (diff)
Gitlab::Git::Stats specs
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/git/stats_spec.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/stats_spec.rb b/spec/lib/gitlab/git/stats_spec.rb
new file mode 100644
index 00000000000..96b04f17e91
--- /dev/null
+++ b/spec/lib/gitlab/git/stats_spec.rb
@@ -0,0 +1,28 @@
+require "spec_helper"
+
+describe Gitlab::Git::Stats do
+ let(:repository) { Gitlab::Git::Repository.new('gitlabhq', 'master') }
+
+ before do
+ @stats = Gitlab::Git::Stats.new(repository.raw, 'master')
+ end
+
+ describe :authors do
+ let(:author) { @stats.authors.first }
+
+ it { author.name.should == 'Dmitriy Zaporozhets' }
+ it { author.email.should == 'dmitriy.zaporozhets@gmail.com' }
+ it { author.commits.should == 254 }
+ end
+
+ describe :graph do
+ let(:graph) { @stats.graph }
+
+ it { graph.labels.should include Date.today.stamp('Aug 23') }
+ it { graph.commits.should be_kind_of(Array) }
+ it { graph.weeks.should == 4 }
+ end
+
+ it { @stats.commits_count.should == 918 }
+ it { @stats.files_count.should == 550 }
+end