forked from sds/overcommit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresolving_merge_conflict_spec.rb
39 lines (34 loc) · 1.06 KB
/
resolving_merge_conflict_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# frozen_string_literal: true
require 'spec_helper'
describe 'resolving merge conflicts' do
subject { shell(%w[git commit -m "Resolve conflicts" -i some-file]) }
around do |example|
repo do
echo('Master', 'some-file')
`git add some-file`
`git commit -m "Add some-file"`
`git checkout -q -b branch1`
echo('Branch 1 Addition', 'some-file')
`git add some-file`
`git commit -m "Add Branch 1 addition"`
`git checkout -q master`
`git checkout -q -b branch2`
echo('Branch 2 Addition', 'some-file')
`git add some-file`
`git commit -m "Add Branch 2 addition"`
`git checkout -q master`
`git merge branch1`
`git merge branch2` # Results in merge conflict
`overcommit --install > #{File::NULL}`
echo('Conflicts Resolved', 'some-file')
`git add some-file`
example.run
end
end
it 'exits successfully' do
subject.status.should == 0
end
it 'does not display an error about MERGE_HEAD missing' do
subject.stderr.should_not include 'MERGE_HEAD'
end
end