Sha256: 3c79d58e237a776e62bac318ac8c70764dc762dc622868d413d10f2c3f079d8e

Contents?: true

Size: 960 Bytes

Versions: 1

Compression:

Stored size: 960 Bytes

Contents

require File.dirname(__FILE__) + '/test_helper'
require 'base64'

context "Rugged::Object stuff" do
  setup do
    @path = File.dirname(__FILE__) + '/fixtures/testrepo.git/'
    @repo = Rugged::Repository.new(@path)
  end

  test "cannot lookup a non-existant object" do
    assert_raise RuntimeError do 
		obj = @repo.lookup("a496071c1b46c854b31185ea97743be6a8774479")
	end
  end

  test "can lookup an object" do
    obj = @repo.lookup("8496071c1b46c854b31185ea97743be6a8774479")
    assert_equal 'commit', obj.type
    assert_equal '8496071c1b46c854b31185ea97743be6a8774479', obj.sha
  end

  test "same looked up objects are the same" do
    obj = @repo.lookup("8496071c1b46c854b31185ea97743be6a8774479")
    obj2 = @repo.lookup("8496071c1b46c854b31185ea97743be6a8774479")
    assert_equal obj, obj2
  end
  
  test "can read raw data from an object" do
    obj = @repo.lookup("8496071c1b46c854b31185ea97743be6a8774479")
    assert obj.read_raw
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rugged-0.0.1 test/object_test.rb