From 32fbe703605310c91677225442a62ae0869d0892 Mon Sep 17 00:00:00 2001 From: scott Chacon Date: Mon, 12 Nov 2007 10:55:39 -0800 Subject: added push, changed some docs, merged README and EXAMPLES, fixed the Rake tasks to build a proper gem --- tests/units/test_remotes.rb | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'tests') diff --git a/tests/units/test_remotes.rb b/tests/units/test_remotes.rb index ddb066e..ecf35a4 100644 --- a/tests/units/test_remotes.rb +++ b/tests/units/test_remotes.rb @@ -41,5 +41,40 @@ class TestRemotes < Test::Unit::TestCase #puts loc.remotes.inspect end end + + def test_push + in_temp_dir do |path| + loc = Git.clone(@wbare, 'local') + rem = Git.clone(@wbare, 'remote') + + r = loc.add_remote('testrem', rem) + + loc.chdir do + new_file('test-file1', 'blahblahblah1') + loc.add + loc.commit('master commit') + + loc.branch('testbranch').in_branch('tb commit') do + new_file('test-file3', 'blahblahblah3') + loc.add + true + end + end + assert(!rem.status['test-file1']) + assert(!rem.status['test-file3']) + + loc.push('testrem') + + assert(rem.status['test-file1']) + assert(!rem.status['test-file3']) + + loc.push('testrem', 'testbranch') + + rem.checkout('testbranch') + assert(rem.status['test-file1']) + assert(rem.status['test-file3']) + end + end + end \ No newline at end of file -- cgit