Skip to content

Commit cf4dc6d

Browse files
jawshooahsds
authored andcommitted
Use overcommit CLI for integration tests
Use overcommit CLI for integration spec This better mirrors the behavior of the cherry pick conflict spec. See 97a00a7 for a more thorough justification Use overcommit CLI for integration tests
1 parent be20427 commit cf4dc6d

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

spec/integration/committing_spec.rb

+2-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
around do |example|
1818
repo do
1919
File.open('.overcommit.yml', 'w') { |f| f.write(config) }
20-
Overcommit::Installer.new(Overcommit::Logger.silent).
21-
run('.', action: :install)
20+
`overcommit --install > #{File::NULL}`
2221
example.run
2322
end
2423
end
@@ -60,8 +59,7 @@
6059

6160
around do |example|
6261
repo do
63-
Overcommit::Installer.new(Overcommit::Logger.silent).
64-
run('.', action: :install)
62+
`overcommit --install > #{File::NULL}`
6563
File.open('.overcommit.yml', 'w') { |f| f.write(config) }
6664
File.open('test.txt', 'w') { |f| f.write(file_contents) }
6765
`git add test.txt`

spec/integration/disable_overcommit_spec.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
around do |example|
77
repo do
8-
Overcommit::Installer.new(Overcommit::Logger.silent).
9-
run('.', action: :install)
8+
`overcommit --install > #{File::NULL}`
109
Overcommit::Utils.with_environment('OVERCOMMIT_DISABLE' => overcommit_disable) do
1110
FileUtils.touch 'blah'
1211
`git add blah`

spec/integration/resolving_merge_conflict_spec.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
`git checkout -q master`
2121
`git merge branch1`
2222
`git merge branch2` # Results in merge conflict
23-
Overcommit::Installer.new(Overcommit::Logger.silent).
24-
run('.', action: :install)
23+
`overcommit --install > #{File::NULL}`
2524
echo('Conflicts Resolved', 'some-file')
2625
`git add some-file`
2726
example.run

0 commit comments

Comments
 (0)