Skip to content

Commit e000374

Browse files
author
Shane da Silva
committed
Simplify repo helper in GitSpecHelpers
Condense two separate calls to `Dir.chdir(path)` into a single call with a block passed in. Change-Id: I41b089981414d4f02757740e411f336d5e18102a Reviewed-on: https://gerrit.causes.com/25222 Tested-by: jenkins <jenkins@causes.com> Reviewed-by: Shane da Silva <shane@causes.com>
1 parent 5dd9f32 commit e000374

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spec/support/git_spec_helpers.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
module GitSpecHelpers
22
def repo(&block)
33
Dir.mktmpdir.tap do |path|
4-
Dir.chdir(path) { `git init` }
5-
Dir.chdir(path, &block)
4+
Dir.chdir(path) do
5+
`git init`
6+
block.call
7+
end
68
end
79
end
810

0 commit comments

Comments
 (0)