Sha256: 0c89dfbb96c30f64bb638248096dc73c3a8cdf104d70de876d3347d3ef2d7a2c

Contents?: true

Size: 731 Bytes

Versions: 10

Compression:

Stored size: 731 Bytes

Contents

require File.dirname(__FILE__) + '/helper'

class TestCommitStats < Test::Unit::TestCase
  
  def setup
    File.expects(:exist?).returns(true)
    @r = Repo.new(GRIT_REPO)

    Git.any_instance.expects(:log).returns(fixture('log'))
    @stats = @r.commit_stats
  end
  
  def test_commit_stats
    assert_equal 3, @stats.size
  end

  # to_hash

  def test_to_hash
    expected = {
      "files"=>
        [["examples/ex_add_commit.rb", 13, 0, 13],
         ["examples/ex_index.rb", 1, 1, 2]],
       "total"=>15,
       "additions"=>14,
       "id"=>"a49b96b339c525d7fd455e0ad4f6fe7b550c9543",
       "deletions"=>1
    }

    assert_equal expected, @stats.assoc('a49b96b339c525d7fd455e0ad4f6fe7b550c9543')[1].to_hash
  end

end

Version data entries

10 entries across 10 versions & 4 rubygems

Version Path
davetron5000-grit-1.1.2 test/test_commit_stats.rb
davetron5000-grit-1.1.3 test/test_commit_stats.rb
joelmoss-grit-1.1.4 test/test_commit_stats.rb
joelmoss-grit-1.1.5 test/test_commit_stats.rb
joelmoss-grit-1.1.6 test/test_commit_stats.rb
square-circle-triangle-grit-1.1.3 test/test_commit_stats.rb
square-circle-triangle-grit-1.1.4 test/test_commit_stats.rb
grit-1.0.0 test/test_commit_stats.rb
grit-1.1.0 test/test_commit_stats.rb
grit-1.0.1 test/test_commit_stats.rb