Skip to content

Commit 7ec43a6

Browse files
committed
Use FileUtils.touch for cross-platform use
1 parent a9066dc commit 7ec43a6

8 files changed

+9
-9
lines changed

spec/integration/disable_overcommit_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
Overcommit::Installer.new(Overcommit::Logger.silent).
99
run('.', action: :install)
1010
Overcommit::Utils.with_environment('OVERCOMMIT_DISABLE' => overcommit_disable) do
11-
`touch blah`
11+
FileUtils.touch 'blah'
1212
`git add blah`
1313
example.run
1414
end

spec/overcommit/hook/pre_commit/berksfile_check_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
context 'when Berksfile.lock is ignored' do
99
around do |example|
1010
repo do
11-
`touch Berksfile.lock`
11+
FileUtils.touch 'Berksfile.lock'
1212
`echo Berksfile.lock > .gitignore`
1313
`git add .gitignore`
1414
`git commit -m "Ignore Berksfile.lock"`

spec/overcommit/hook/pre_commit/bundle_check_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
context 'when Gemfile.lock is ignored' do
99
around do |example|
1010
repo do
11-
`touch Gemfile.lock`
11+
FileUtils.touch 'Gemfile.lock'
1212
`echo Gemfile.lock > .gitignore`
1313
`git add .gitignore`
1414
`git commit -m "Ignore Gemfile.lock"`

spec/overcommit/hook/pre_commit/json_syntax_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
around do |example|
1616
repo do
17-
`touch #{staged_file}`
17+
FileUtils.touch staged_file
1818
`git add #{staged_file}`
1919
example.run
2020
end

spec/overcommit/hook_context/post_commit_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
it 'does not include submodules' do
1414
submodule = repo do
15-
`touch foo`
15+
FileUtils.touch 'foo'
1616
`git add foo`
1717
`git commit -m "Initial commit"`
1818
end

spec/overcommit/hook_context/post_merge_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484

8585
it 'does not include submodules' do
8686
submodule = repo do
87-
`touch foo`
87+
FileUtils.touch 'foo'
8888
`git add foo`
8989
`git commit -m "Initial commit"`
9090
end

spec/overcommit/hook_context/pre_commit_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
around do |example|
155155
repo do
156156
`git commit --allow-empty -m "Initial commit"`
157-
`touch some-file`
157+
FileUtils.touch 'some-file'
158158
`git add some-file`
159159
`git commit -m "Add file"`
160160
`git mv some-file renamed-file`
@@ -407,7 +407,7 @@
407407

408408
it 'does not include submodules' do
409409
submodule = repo do
410-
`touch foo`
410+
FileUtils.touch 'foo'
411411
`git add foo`
412412
`git commit -m "Initial commit"`
413413
end

spec/overcommit/hook_context/run_all_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
context 'when repo contains submodules' do
3939
around do |example|
4040
submodule = repo do
41-
`touch foo`
41+
FileUtils.touch 'foo'
4242
`git add foo`
4343
`git commit -m "Initial commit"`
4444
end

0 commit comments

Comments
 (0)