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