summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-15 17:11:58 -0800
committerscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-15 17:11:58 -0800
commit3687e45effe8ad433da31712149b424d46effe64 (patch)
treee37e6af8d500be941a294d53157b6a29907e2d8d /tests
parente806b6bc193ced4c562f69f28490e6c9bcb622a4 (diff)
downloadthird_party-ruby-git-3687e45effe8ad433da31712149b424d46effe64.zip
third_party-ruby-git-3687e45effe8ad433da31712149b424d46effe64.tar.gz
third_party-ruby-git-3687e45effe8ad433da31712149b424d46effe64.tar.xz
forgot gblob
Diffstat (limited to 'tests')
-rw-r--r--tests/units/test_object.rb28
1 files changed, 14 insertions, 14 deletions
diff --git a/tests/units/test_object.rb b/tests/units/test_object.rb
index c6ee5ce..5b04054 100644
--- a/tests/units/test_object.rb
+++ b/tests/units/test_object.rb
@@ -7,13 +7,13 @@ class TestObject < Test::Unit::TestCase
set_file_paths
@git = Git.open(@wdir)
- @commit = @git.object('1cc8667014381')
- @tree = @git.object('1cc8667014381^{tree}')
- @blob = @git.object('v2.5:example.txt')
+ @commit = @git.gcommit('1cc8667014381')
+ @tree = @git.gtree('1cc8667014381^{tree}')
+ @blob = @git.gblob('v2.5:example.txt')
end
def test_commit
- o = @git.object('1cc8667014381')
+ o = @git.gcommit('1cc8667014381')
assert(o.is_a?(Git::Object::Commit))
assert(o.commit?)
assert(!o.tag?)
@@ -34,17 +34,17 @@ class TestObject < Test::Unit::TestCase
assert_equal('master', o.parent.parent.name)
assert_equal('master~1', o.parent.parent.parent.name)
- o = @git.object('HEAD')
+ o = @git.gcommit('HEAD')
assert(o.is_a?(Git::Object::Commit))
assert_equal('commit', o.type)
- o = @git.object('test_object')
+ o = @git.gcommit('test_object')
assert(o.is_a?(Git::Object::Commit))
assert_equal('commit', o.type)
end
def test_commit_contents
- o = @git.object('1cc8667014381')
+ o = @git.gcommit('1cc8667014381')
assert_equal('tree 94c827875e2cadb8bc8d4cdd900f19aa9e8634c7', o.contents_array[0])
assert_equal('parent 546bec6f8872efa41d5d97a369f669165ecda0de', o.contents_array[1])
end
@@ -62,39 +62,39 @@ class TestObject < Test::Unit::TestCase
end
def test_tree
- o = @git.object('1cc8667014381^{tree}')
+ o = @git.gtree('1cc8667014381^{tree}')
assert(o.is_a?(Git::Object::Tree))
assert(o.tree?)
- o = @git.object('v2.7^{tree}')
+ o = @git.gtree('v2.7^{tree}')
assert_equal(2, o.children.size)
assert_equal(1, o.blobs.size)
assert_equal(1, o.subtrees.size)
assert_equal(1, o.trees['ex_dir'].blobs.size)
- o = @git.object('94c827875e2cadb8bc8d4cdd900f19aa9e8634c7')
+ o = @git.gtree('94c827875e2cadb8bc8d4cdd900f19aa9e8634c7')
assert(o.is_a?(Git::Object::Tree))
assert_equal('tree', o.type)
end
def test_tree_contents
- o = @git.object('1cc8667014381^{tree}')
+ o = @git.gtree('1cc8667014381^{tree}')
assert_equal('040000 tree 6b790ddc5eab30f18cabdd0513e8f8dac0d2d3ed ex_dir', o.contents_array.first)
end
def test_blob
- o = @git.object('ba492c62b6')
+ o = @git.gblob('ba492c62b6')
assert(o.is_a?(Git::Object::Blob))
assert(o.blob?)
- o = @git.object('v2.5:example.txt')
+ o = @git.gblob('v2.5:example.txt')
assert(o.is_a?(Git::Object::Blob))
assert_equal('blob', o.type)
end
def test_blob_contents
- o = @git.object('v2.6:example.txt')
+ o = @git.gblob('v2.6:example.txt')
assert_equal('replace with new text', o.contents)
assert_equal('replace with new text', o.contents) # this should be cached
end