summaryrefslogtreecommitdiffstats
path: root/tests/units/test_each_conflict.rb
diff options
context:
space:
mode:
authorScott Chacon <schacon@gmail.com>2008-03-03 14:47:01 -0800
committerScott Chacon <schacon@gmail.com>2008-03-03 14:47:01 -0800
commit2d749e3aa69d7bfedf814f59618f964fdbc300d5 (patch)
tree1f90a2b94dd097c227fcd0dcc2d2eaab9725621c /tests/units/test_each_conflict.rb
parentbc09a701262425adee32030c3b25f8b1c0be776e (diff)
downloadthird_party-ruby-git-2d749e3aa69d7bfedf814f59618f964fdbc300d5.zip
third_party-ruby-git-2d749e3aa69d7bfedf814f59618f964fdbc300d5.tar.gz
third_party-ruby-git-2d749e3aa69d7bfedf814f59618f964fdbc300d5.tar.xz
added patch from eric goodwin for stashes and unit tests for stashes
Diffstat (limited to 'tests/units/test_each_conflict.rb')
-rw-r--r--tests/units/test_each_conflict.rb49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/units/test_each_conflict.rb b/tests/units/test_each_conflict.rb
new file mode 100644
index 0000000..c5c9bb4
--- /dev/null
+++ b/tests/units/test_each_conflict.rb
@@ -0,0 +1,49 @@
+#!/usr/bin/env ruby
+
+require File.dirname(__FILE__) + '/../test_helper'
+
+class TestEachConflict < Test::Unit::TestCase
+
+ def setup
+ set_file_paths
+ #@git = Git.open(@wdir, :log => Logger.new(STDOUT))
+ @git = Git.open(@wdir)
+ end
+
+ def test_conflicts
+ in_temp_dir do |path|
+ g = Git.clone(@wbare, 'branch_merge_test')
+ Dir.chdir('branch_merge_test') do
+
+ g.branch('new_branch').in_branch('test') do
+ new_file('example.txt', "1\n2\n3")
+ g.add
+ true
+ end
+
+ g.branch('new_branch2').in_branch('test') do
+ new_file('example.txt', "1\n4\n3")
+ g.add
+ true
+ end
+
+
+ g.merge('new_branch')
+ begin
+ g.merge('new_branch2')
+ rescue
+ end
+
+ g.each_conflict do |file, your, their|
+ assert_equal('example.txt', file)
+ assert_equal("1\n2\n3\n", File.read(your))
+ assert_equal("1\n4\n3\n", File.read(their))
+ end
+
+ end
+ end
+ end
+
+
+
+end \ No newline at end of file