summaryrefslogtreecommitdiffstats
path: root/tests/units
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units')
-rw-r--r--tests/units/test_branch.rb3
-rw-r--r--tests/units/test_repack.rb30
2 files changed, 31 insertions, 2 deletions
diff --git a/tests/units/test_branch.rb b/tests/units/test_branch.rb
index bc7d807..d54b526 100644
--- a/tests/units/test_branch.rb
+++ b/tests/units/test_branch.rb
@@ -13,7 +13,6 @@ class TestBranch < Test::Unit::TestCase
@branches = @git.branches
end
-
def test_branches_all
assert(@git.branches[:master].is_a?(Git::Branch))
@@ -38,7 +37,7 @@ class TestBranch < Test::Unit::TestCase
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('+refs/heads/*:refs/remotes/working/*', b.remote.fetch_opts)
assert_equal('../working.git', b.remote.url)
end
diff --git a/tests/units/test_repack.rb b/tests/units/test_repack.rb
new file mode 100644
index 0000000..605954f
--- /dev/null
+++ b/tests/units/test_repack.rb
@@ -0,0 +1,30 @@
+#!/usr/bin/env ruby
+
+require File.dirname(__FILE__) + '/../test_helper'
+
+class TestRepack < Test::Unit::TestCase
+ def setup
+ set_file_paths
+ end
+
+ def test_repack
+ in_temp_dir do |path|
+ r1 = Git.clone(@wbare, 'repo1')
+
+
+ r1.chdir do
+ new_file('new_file', 'new content')
+ end
+ r1.add
+ r1.commit('my commit')
+
+ # see how big the repo is
+ size1 = r1.repo_size
+
+ r1.repack
+
+ # see how big the repo is now, should be smaller
+ assert(size1 > r1.repo_size)
+ end
+ end
+end \ No newline at end of file