From 1d845799ebc05bee9e3a68b7ad9dd5015277ca41 Mon Sep 17 00:00:00 2001 From: Scott Chacon Date: Sat, 8 Mar 2008 18:14:15 -0800 Subject: reverted the pure ruby code to system calls and split the pure ruby to a new library --- tests/files/working/dot_git/config | 3 +++ tests/units/test_config.rb | 6 ++--- tests/units/test_raw_internals.rb | 53 -------------------------------------- 3 files changed, 6 insertions(+), 56 deletions(-) delete mode 100644 tests/units/test_raw_internals.rb (limited to 'tests') diff --git a/tests/files/working/dot_git/config b/tests/files/working/dot_git/config index 073357b..d28b4c0 100644 --- a/tests/files/working/dot_git/config +++ b/tests/files/working/dot_git/config @@ -1,3 +1,6 @@ +[user] + name = Scott Chacon + email = schacon@gmail.com [core] repositoryformatversion = 0 filemode = true diff --git a/tests/units/test_config.rb b/tests/units/test_config.rb index 46ccd1e..f1722de 100644 --- a/tests/units/test_config.rb +++ b/tests/units/test_config.rb @@ -10,19 +10,19 @@ class TestConfig < Test::Unit::TestCase def test_config c = @git.config - assert_equal('scott Chacon', c['user.name']) + assert_equal('Scott Chacon', c['user.name']) assert_equal('false', c['core.bare']) end def test_read_config - assert_equal('scott Chacon', @git.config('user.name')) + assert_equal('Scott Chacon', @git.config('user.name')) assert_equal('false', @git.config('core.bare')) end def test_set_config in_temp_dir do |path| g = Git.clone(@wbare, 'bare') - assert_equal('scott Chacon', g.config('user.name')) + assert_equal('Scott Chacon', g.config('user.name')) g.config('user.name', 'bully') assert_equal('bully', g.config('user.name')) end diff --git a/tests/units/test_raw_internals.rb b/tests/units/test_raw_internals.rb deleted file mode 100644 index b37a66d..0000000 --- a/tests/units/test_raw_internals.rb +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env ruby -require 'logger' -require File.dirname(__FILE__) + '/../test_helper' - -class TestRawInternals < Test::Unit::TestCase - - def setup - set_file_paths - end - - def test_raw_log - with_temp_bare do |g| - t_log(g) - end - end - - def test_packed_log - with_temp_bare do |g| - g.repack - t_log(g) - end - end - - def test_commit_object - g = Git.bare(@wbare) - c = g.gcommit("v2.5") - assert_equal('test', c.message) - end - - def test_lstree - g = Git.bare(@wbare) - c = g.object("v2.5").gtree - sha = c.sha - - repo = Git::Raw::Repository.new(@wbare) - assert_equal('ex_dir', repo.object(sha).entry.first.name) - end - - def t_log(g) - c = g.object("v2.5") - sha = c.sha - - repo = Git::Raw::Repository.new(g.repo.path) - raw_out = repo.log(sha) - - assert_equal('commit 546bec6f8872efa41d5d97a369f669165ecda0de', raw_out.split("\n").first) - assert_equal('546bec6f8872efa41d5d97a369f669165ecda0de', c.log(30).first.sha) - end - - - - -end \ No newline at end of file -- cgit