summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-15 16:24:39 -0800
committerscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-15 16:24:39 -0800
commita6e6c0552708166ea052a99bdd9420dcc33536e0 (patch)
treea609b25f48da342d2ee7f9f25dc30d85ac88630d /tests
parent36546122feb52520ba005b8c0fd452d766dc06be (diff)
downloadthird_party-ruby-git-a6e6c0552708166ea052a99bdd9420dcc33536e0.zip
third_party-ruby-git-a6e6c0552708166ea052a99bdd9420dcc33536e0.tar.gz
third_party-ruby-git-a6e6c0552708166ea052a99bdd9420dcc33536e0.tar.xz
added unit tests for object predicates
Diffstat (limited to 'tests')
-rw-r--r--tests/units/test_object.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/units/test_object.rb b/tests/units/test_object.rb
index db04bd6..acc32b0 100644
--- a/tests/units/test_object.rb
+++ b/tests/units/test_object.rb
@@ -15,6 +15,8 @@ class TestObject < Test::Unit::TestCase
def test_commit
o = @git.object('1cc8667014381')
assert(o.is_a?(Git::Object::Commit))
+ assert(o.commit?)
+ assert(!o.tag?)
assert_equal('94c827875e2cadb8bc8d4cdd900f19aa9e8634c7', o.gtree.to_s)
assert_equal('546bec6f8872efa41d5d97a369f669165ecda0de', o.parent.sha)
@@ -62,6 +64,7 @@ class TestObject < Test::Unit::TestCase
def test_tree
o = @git.object('1cc8667014381^{tree}')
assert(o.is_a?(Git::Object::Tree))
+ assert(o.tree?)
o = @git.object('v2.7^{tree}')
@@ -83,6 +86,7 @@ class TestObject < Test::Unit::TestCase
def test_blob
o = @git.object('ba492c62b6')
assert(o.is_a?(Git::Object::Blob))
+ assert(o.blob?)
o = @git.object('v2.5:example.txt')
assert(o.is_a?(Git::Object::Blob))