Sha256: 16f8727ec8b7e4a5a4a738f0dbd2ff35d388f31999965c83367c7bd7cfb269f4

Contents?: true

Size: 878 Bytes

Versions: 1

Compression:

Stored size: 878 Bytes

Contents

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

class TestHead < Test::Unit::TestCase
  def setup
    @r = Repo.new(File.join(File.dirname(__FILE__), *%w[dot_git]), :is_bare => true)
  end
  
  # inspect
  
  def test_inspect
    head = @r.heads.first
    assert_equal %Q{#<Grit::Head "test/master">}, head.inspect
  end

  def test_master
    head = @r.commit('master')
    assert_equal 'ca8a30f5a7f0f163bbe3b6f0abf18a6c83b0687a', head.id
  end

  def test_submaster
    head = @r.commit('test/master')
    assert_equal '2d3acf90f35989df8f262dc50beadc4ee3ae1560', head.id
  end
  
  # heads with slashes

  def test_heads_with_slashes
    head = @r.heads[2]
    assert_equal %Q{#<Grit::Head "test/chacon">}, head.inspect
  end

  def test_head_count
    assert_equal 5, @r.heads.size
  end


  def test_nonpack
    assert @r.heads.map { |h| h.name }.include?('nonpack')
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
schacon-grit-0.9.1 test/test_head.rb