summaryrefslogtreecommitdiffstats
path: root/tests/units/test_remotes.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units/test_remotes.rb')
-rw-r--r--tests/units/test_remotes.rb45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/units/test_remotes.rb b/tests/units/test_remotes.rb
new file mode 100644
index 0000000..ddb066e
--- /dev/null
+++ b/tests/units/test_remotes.rb
@@ -0,0 +1,45 @@
+#!/usr/bin/env ruby
+
+require File.dirname(__FILE__) + '/../test_helper'
+
+class TestRemotes < Test::Unit::TestCase
+ def setup
+ set_file_paths
+ end
+
+ def test_remote_fun
+ in_temp_dir do |path|
+ loc = Git.clone(@wbare, 'local')
+ rem = Git.clone(@wbare, 'remote')
+
+ r = loc.add_remote('testrem', rem)
+
+ Dir.chdir('remote') do
+ new_file('test-file1', 'blahblahblah1')
+ rem.add
+ rem.commit('master commit')
+
+ rem.branch('testbranch').in_branch('tb commit') do
+ new_file('test-file3', 'blahblahblah3')
+ rem.add
+ true
+ end
+ end
+ assert(!loc.status['test-file1'])
+ assert(!loc.status['test-file3'])
+
+ r.fetch
+ r.merge
+ assert(loc.status['test-file1'])
+
+ loc.merge(loc.remote('testrem').branch('testbranch'))
+ assert(loc.status['test-file3'])
+
+ #puts loc.remotes.map { |r| r.to_s }.inspect
+
+ #r.remove
+ #puts loc.remotes.inspect
+ end
+ end
+
+end \ No newline at end of file