From 1716749e66a302e9a84b5e64c694a5dd3c542e26 Mon Sep 17 00:00:00 2001 From: Postmodern Date: Sat, 13 Apr 2024 21:27:42 -0700 Subject: [PATCH] Use `Dir.chdir` instead of `git -C "..."`. --- spec/cli/commands/new_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/cli/commands/new_spec.rb b/spec/cli/commands/new_spec.rb index 0c011e2..0c892aa 100644 --- a/spec/cli/commands/new_spec.rb +++ b/spec/cli/commands/new_spec.rb @@ -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