Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 34 lines (25 sloc) 0.727 kB
e9b9a0f @schacon added commit_stats stuff
schacon authored
1 require File.dirname(__FILE__) + '/helper'
2
3 class TestCommitStats < Test::Unit::TestCase
18ec70e @mojombo massive whitespace removal
mojombo authored
4
e9b9a0f @schacon added commit_stats stuff
schacon authored
5 def setup
6 File.expects(:exist?).returns(true)
7 @r = Repo.new(GRIT_REPO)
8
9 Git.any_instance.expects(:log).returns(fixture('log'))
10 @stats = @r.commit_stats
11 end
18ec70e @mojombo massive whitespace removal
mojombo authored
12
e9b9a0f @schacon added commit_stats stuff
schacon authored
13 def test_commit_stats
14 assert_equal 3, @stats.size
15 end
16
17 # to_hash
18
19 def test_to_hash
20 expected = {
21 "files"=>
22 [["examples/ex_add_commit.rb", 13, 0, 13],
23 ["examples/ex_index.rb", 1, 1, 2]],
24 "total"=>15,
25 "additions"=>14,
26 "id"=>"a49b96b339c525d7fd455e0ad4f6fe7b550c9543",
27 "deletions"=>1
28 }
29
30 assert_equal expected, @stats.assoc('a49b96b339c525d7fd455e0ad4f6fe7b550c9543')[1].to_hash
31 end
32
33 end
Something went wrong with that request. Please try again.