Skip to content

Commit

Permalink
Use Dir.chdir instead of git -C "...".
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Apr 14, 2024
1 parent 9d7ffe9 commit 1716749
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/cli/commands/new_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
end

it "must make an initial git commit" do
expect(`git -C "#{@path}" log --pretty=oneline`).to match(
/[0-9a-f]{40} Initial commit./
)
git_log = Dir.chdir(@path) { `git log --pretty=oneline` }

expect(git_log).to match(/[0-9a-f]{40} Initial commit./)
end

it "must create a README.md file within the directory" do
Expand Down

0 comments on commit 1716749

Please sign in to comment.