diff options
author | scott Chacon <schacon@agadorsparticus.corp.reactrix.com> | 2007-11-09 13:11:22 -0800 |
---|---|---|
committer | scott Chacon <schacon@agadorsparticus.corp.reactrix.com> | 2007-11-09 13:11:22 -0800 |
commit | 9d59d2965184964ab6662282ef5f9ceac2c58552 (patch) | |
tree | f8dd8bf4004eb9403f9ffe2b5c5c708ef877895a /tests/units/test_branch.rb | |
parent | ab20a674e50268b6c541949c746d77b16a26d15c (diff) | |
download | third_party-ruby-git-9d59d2965184964ab6662282ef5f9ceac2c58552.tar.gz third_party-ruby-git-9d59d2965184964ab6662282ef5f9ceac2c58552.tar.xz third_party-ruby-git-9d59d2965184964ab6662282ef5f9ceac2c58552.zip |
added branches, more log stuff, better tests, changed the log api a bit
added tests for Git::Lib, started Git::Diff development
Diffstat (limited to 'tests/units/test_branch.rb')
-rw-r--r-- | tests/units/test_branch.rb | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/units/test_branch.rb b/tests/units/test_branch.rb new file mode 100644 index 0000000..ea242fc --- /dev/null +++ b/tests/units/test_branch.rb @@ -0,0 +1,49 @@ +#!/usr/bin/env ruby + +require File.dirname(__FILE__) + '/../test_helper' + +class TestBranch < Test::Unit::TestCase + def setup + set_file_paths + @git = Git.open(@wdir) + + @commit = @git.object('1cc8667014381') + @tree = @git.object('1cc8667014381^{tree}') + @blob = @git.object('v2.5:example.txt') + + @branches = @git.branches + end + + + def test_branches_all + assert(@git.branches[:master].is_a?(Git::Branch)) + assert(@git.branches.size > 5) + end + + def test_branches_local + bs = @git.branches.local + assert(bs.size > 4) + end + + def test_branches_remote + bs = @git.branches.remote + assert_equal(1, bs.size) + end + + def test_branches_single + b = @git.branches[:test_object] + assert_equal('test_object', b.name) + + b = @git.branches['working/master'] + assert_equal('master', b.name) + assert_equal('working/master', b.full) + assert_equal('working', b.remote.name) + assert_equal('+refs/heads/*:refs/remotes/working/*', b.remote.fetch) + assert_equal('../working.git', b.remote.url) + end + + def test_branch_commit + assert_equal(270, @git.branches[:test_branches].commit.size) + end + +end
\ No newline at end of file |