summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-12 10:55:39 -0800
committerscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-12 10:55:39 -0800
commit32fbe703605310c91677225442a62ae0869d0892 (patch)
tree00c2b73a07e1200e097490c1fa7d6b5a77fa2032 /tests
parent646304a6e7c3b2c442a0a7db995629e7009c3a14 (diff)
downloadthird_party-ruby-git-32fbe703605310c91677225442a62ae0869d0892.zip
third_party-ruby-git-32fbe703605310c91677225442a62ae0869d0892.tar.gz
third_party-ruby-git-32fbe703605310c91677225442a62ae0869d0892.tar.xz
added push, changed some docs, merged README and EXAMPLES, fixed the Rake tasks to build a proper gem
Diffstat (limited to 'tests')
-rw-r--r--tests/units/test_remotes.rb35
1 files changed, 35 insertions, 0 deletions
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