Commit 211c433cd89ddc49b1f8c3ef6ba7bc366428a851
1 parent
be41d0e1
Exists in
master
and in
4 other branches
Gitlab::Git::Stats specs
Showing
1 changed file
with
28 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,28 @@ |
| 1 | +require "spec_helper" | |
| 2 | + | |
| 3 | +describe Gitlab::Git::Stats do | |
| 4 | + let(:repository) { Gitlab::Git::Repository.new('gitlabhq', 'master') } | |
| 5 | + | |
| 6 | + before do | |
| 7 | + @stats = Gitlab::Git::Stats.new(repository.raw, 'master') | |
| 8 | + end | |
| 9 | + | |
| 10 | + describe :authors do | |
| 11 | + let(:author) { @stats.authors.first } | |
| 12 | + | |
| 13 | + it { author.name.should == 'Dmitriy Zaporozhets' } | |
| 14 | + it { author.email.should == 'dmitriy.zaporozhets@gmail.com' } | |
| 15 | + it { author.commits.should == 254 } | |
| 16 | + end | |
| 17 | + | |
| 18 | + describe :graph do | |
| 19 | + let(:graph) { @stats.graph } | |
| 20 | + | |
| 21 | + it { graph.labels.should include Date.today.stamp('Aug 23') } | |
| 22 | + it { graph.commits.should be_kind_of(Array) } | |
| 23 | + it { graph.weeks.should == 4 } | |
| 24 | + end | |
| 25 | + | |
| 26 | + it { @stats.commits_count.should == 918 } | |
| 27 | + it { @stats.files_count.should == 550 } | |
| 28 | +end | ... | ... |