From 10045d082117d4ef35da31e1c5a825507b02dd97 Mon Sep 17 00:00:00 2001 From: scott Chacon Date: Thu, 8 Nov 2007 17:25:41 -0800 Subject: got all the unit tests to run from either place, fixed some old functionality --- tests/units/test_object.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tests/units/test_object.rb') diff --git a/tests/units/test_object.rb b/tests/units/test_object.rb index 610a640..b535be7 100644 --- a/tests/units/test_object.rb +++ b/tests/units/test_object.rb @@ -2,7 +2,7 @@ require File.dirname(__FILE__) + '/../test_helper' -class TestInit < Test::Unit::TestCase +class TestObject < Test::Unit::TestCase def setup set_file_paths @git = Git.open(@wdir) @@ -27,6 +27,17 @@ class TestInit < Test::Unit::TestCase assert_equal('parent 546bec6f8872efa41d5d97a369f669165ecda0de', o.contents_array[1]) end + def test_object_to_s + o = @git.object('1cc8667014381') + assert_equal('commit 1cc8667014381e2788a94777532a788307f38d26', o.to_s) + + o = @git.object('1cc8667014381^{tree}') + assert_equal('tree 94c827875e2cadb8bc8d4cdd900f19aa9e8634c7', o.to_s) + + o = @git.object('v2.5:example.txt') + assert_equal('blob ba492c62b6227d7f3507b4dcc6e6d5f13790eabf', o.to_s) + end + def test_tree o = @git.object('1cc8667014381^{tree}') assert(o.is_a?(Git::Object::Tree)) -- cgit