Sha256: db705c890b30d8c755e7574d3ab4dcb491b1cff5600cae8aa871dfc52acd3184

Contents?: true

Size: 869 Bytes

Versions: 11

Compression:

Stored size: 869 Bytes

Contents

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

class TestRubyGitIv2 < Test::Unit::TestCase
  
  def setup
    @git = Grit::Repo.new(File.join(File.dirname(__FILE__), *%w[dot_git_iv2]), :is_bare => true)
    @rgit = @git.git.ruby_git
    @commit_sha = 'ca8a30f5a7f0f163bbe3b6f0abf18a6c83b0687a'
    @tree_sha   = 'cd7422af5a2e0fff3e94d6fb1a8fff03b2841881'
    @blob_sha   = '4232d073306f01cf0b895864e5a5cfad7dd76fce'
  end

  def test_basic
    assert @rgit.object_exists?(@commit_sha)
    assert_equal 10, @git.commits.size
  end
  
  def test_objects
    commit = @rgit.get_object_by_sha1(@commit_sha)
    assert_equal commit.author.email, 'schacon@gmail.com'
    tree = @rgit.get_object_by_sha1(@tree_sha)
    assert_equal 7, tree.entry.size
    blob = @rgit.get_object_by_sha1(@blob_sha)
    assert_match 'First public release', blob.content
  end
    
end

Version data entries

11 entries across 11 versions & 5 rubygems

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