diff options
author | scott Chacon <schacon@agadorsparticus.corp.reactrix.com> | 2007-11-08 17:25:41 -0800 |
---|---|---|
committer | scott Chacon <schacon@agadorsparticus.corp.reactrix.com> | 2007-11-08 17:25:41 -0800 |
commit | 10045d082117d4ef35da31e1c5a825507b02dd97 (patch) | |
tree | b418c5d28334e8514a075effc20c1ebdcbf34a25 /tests/units/test_object.rb | |
parent | 1f63953f05a4afe74f881d54f69f77da513939d5 (diff) | |
download | third_party-ruby-git-10045d082117d4ef35da31e1c5a825507b02dd97.tar.gz third_party-ruby-git-10045d082117d4ef35da31e1c5a825507b02dd97.tar.xz third_party-ruby-git-10045d082117d4ef35da31e1c5a825507b02dd97.zip |
got all the unit tests to run from either place, fixed some old functionality
Diffstat (limited to 'tests/units/test_object.rb')
-rw-r--r-- | tests/units/test_object.rb | 13 |
1 files changed, 12 insertions, 1 deletions
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)) |