summaryrefslogtreecommitdiffstats
path: root/tests/units
diff options
context:
space:
mode:
authorscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-15 15:19:33 -0800
committerscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-15 15:19:33 -0800
commit877662762990b766d071ff272160e8a7bbe85441 (patch)
tree72e845ded8c864231df1e13f6b3bf88766bfa56f /tests/units
parent219fb3570565e9af3819149c6c5fa4df7347daf0 (diff)
downloadthird_party-ruby-git-877662762990b766d071ff272160e8a7bbe85441.zip
third_party-ruby-git-877662762990b766d071ff272160e8a7bbe85441.tar.gz
third_party-ruby-git-877662762990b766d071ff272160e8a7bbe85441.tar.xz
new bare testing repo
Diffstat (limited to 'tests/units')
-rw-r--r--tests/units/test_bare.rb41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/units/test_bare.rb b/tests/units/test_bare.rb
new file mode 100644
index 0000000..2e5aca1
--- /dev/null
+++ b/tests/units/test_bare.rb
@@ -0,0 +1,41 @@
+#!/usr/bin/env ruby
+
+require File.dirname(__FILE__) + '/../test_helper'
+
+class TestBare < Test::Unit::TestCase
+
+ def setup
+ set_file_paths
+ @git = Git.bare(@wbare)
+ end
+
+ def test_commit
+ o = @git.object('1cc8667014381')
+ assert(o.is_a?(Git::Object::Commit))
+
+ assert_equal('94c827875e2cadb8bc8d4cdd900f19aa9e8634c7', o.gtree.to_s)
+ assert_equal('546bec6f8872efa41d5d97a369f669165ecda0de', o.parent.sha)
+ assert_equal(1, o.parents.size)
+ assert_equal('scott Chacon', o.author.name)
+ assert_equal('schacon@agadorsparticus.corp.reactrix.com', o.author.email)
+ assert_equal('11-08-07', o.author.date.strftime("%m-%d-%y"))
+ assert_equal('11-08-07', o.author_date.strftime("%m-%d-%y"))
+ assert_equal('scott Chacon', o.committer.name)
+ assert_equal('11-08-07', o.committer_date.strftime("%m-%d-%y"))
+ assert_equal('11-08-07', o.date.strftime("%m-%d-%y"))
+ assert_equal('test', o.message)
+
+ assert_equal('tags/v2.5', o.parent.name)
+ assert_equal('master', o.parent.parent.name)
+ assert_equal('master~1', o.parent.parent.parent.name)
+
+ o = @git.object('HEAD')
+ assert(o.is_a?(Git::Object::Commit))
+ assert_equal('commit', o.type)
+
+ o = @git.object('test_object')
+ assert(o.is_a?(Git::Object::Commit))
+ assert_equal('commit', o.type)
+ end
+
+end \ No newline at end of file