summaryrefslogtreecommitdiffstats
path: root/tests/units
diff options
context:
space:
mode:
authorscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-08 17:25:41 -0800
committerscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-08 17:25:41 -0800
commit10045d082117d4ef35da31e1c5a825507b02dd97 (patch)
treeb418c5d28334e8514a075effc20c1ebdcbf34a25 /tests/units
parent1f63953f05a4afe74f881d54f69f77da513939d5 (diff)
downloadthird_party-ruby-git-10045d082117d4ef35da31e1c5a825507b02dd97.zip
third_party-ruby-git-10045d082117d4ef35da31e1c5a825507b02dd97.tar.gz
third_party-ruby-git-10045d082117d4ef35da31e1c5a825507b02dd97.tar.xz
got all the unit tests to run from either place, fixed some old functionality
Diffstat (limited to 'tests/units')
-rw-r--r--tests/units/test_log.rb6
-rw-r--r--tests/units/test_object.rb13
2 files changed, 15 insertions, 4 deletions
diff --git a/tests/units/test_log.rb b/tests/units/test_log.rb
index ddd4988..770c245 100644
--- a/tests/units/test_log.rb
+++ b/tests/units/test_log.rb
@@ -2,7 +2,7 @@
require File.dirname(__FILE__) + '/../test_helper'
-class TestInit < Test::Unit::TestCase
+class TestLog < Test::Unit::TestCase
def setup
set_file_paths
@git = Git.open(@wdir)
@@ -10,7 +10,7 @@ class TestInit < Test::Unit::TestCase
def test_get_log_entries
log = @git.log
- assert(log.first.is_a?(Git::Commit))
+ assert(log.first.is_a?(Git::Object::Commit))
end
def test_get_log_entries
@@ -36,7 +36,7 @@ class TestInit < Test::Unit::TestCase
assert_equal(30, l.size)
l = @git.log.between('v2.5').file('example.txt')
- assert_equal(1, l.size)
+ assert_equal(2, l.size)
l = @git.log.between('v2.5', 'test').file('example.txt')
assert_equal(1, l.size)
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))