Sha256: e017ad05ac1d96371529c97c117c1a76eb60d926e43a712fa32153fe056e23d8

Contents?: true

Size: 984 Bytes

Versions: 20

Compression:

Stored size: 984 Bytes

Contents

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

class TestBlame < Test::Unit::TestCase

  def setup
    @r = Repo.new(File.join(File.dirname(__FILE__), *%w[dot_git]), :is_bare => true)
  end

  def test_simple_blame
    commit = '2d3acf90f35989df8f262dc50beadc4ee3ae1560'
    blame = @r.blame('History.txt', commit)
    assert_equal 5, blame.lines.size
    line = blame.lines[2]
    assert_equal '* 1 major enhancement', line.line
    assert_equal 3, line.lineno
    assert_equal 3, line.oldlineno
    assert_equal '634396b2f541a9f2d58b00be1a07f0c358b999b3', line.commit.id
  end

  def test_depth_blame
    commit = '2d3acf90f35989df8f262dc50beadc4ee3ae1560'
    blame = @r.blame('lib/grit.rb', commit)
    assert_equal 37, blame.lines.size
    line = blame.lines[24]
    assert_equal "require 'grit/diff'", line.line
    assert_equal 25, line.lineno
    assert_equal 16, line.oldlineno
    assert_equal '46291865ba0f6e0c9818b11be799fe2db6964d56', line.commit.id
  end

end

Version data entries

20 entries across 20 versions & 7 rubygems

Version Path
boof-grit-1.1.2 test/test_blame.rb
davetron5000-grit-1.1.2 test/test_blame.rb
davetron5000-grit-1.1.3 test/test_blame.rb
joelmoss-grit-1.1.4 test/test_blame.rb
joelmoss-grit-1.1.5 test/test_blame.rb
joelmoss-grit-1.1.6 test/test_blame.rb
square-circle-triangle-grit-1.1.3 test/test_blame.rb
square-circle-triangle-grit-1.1.4 test/test_blame.rb
madrox-0.2.0 vendor/grit/test/test_blame.rb
madrox-0.1.1 vendor/grit/test/test_blame.rb
madrox-0.1.0 vendor/grit/test/test_blame.rb
ginst-2009.12.8 vendor/plugins/grit/test/test_blame.rb
ginst-2009.11.24 vendor/plugins/grit/test/test_blame.rb
ginst-2009.11.23 vendor/plugins/grit/test/test_blame.rb
ginst-2.0.1 vendor/plugins/grit/test/test_blame.rb
ginst-2.0.0 vendor/plugins/grit/test/test_blame.rb
grit-2.0.0 test/test_blame.rb
grit-1.0.0 test/test_blame.rb
grit-1.0.1 test/test_blame.rb
grit-1.1.0 test/test_blame.rb