From 55f4340dbab802c4aedcc07a0ac3f81421f5db6c Mon Sep 17 00:00:00 2001 From: Oliver Peate Date: Sat, 5 Mar 2022 14:34:41 +0000 Subject: [PATCH] Fix spec helper on MacOS If the detected path to Chrome includes spaces (which is does by default on MacOS) then the version check command would fail, preventing the test suite from running. --- spec/spec_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 70e03d0..3efdf1d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,6 +4,7 @@ $LOAD_PATH.unshift("#{CUPRITE_ROOT}/lib") require "fileutils" +require "shellwords" require "bundler/setup" require "rspec" @@ -15,7 +16,7 @@ puts "" command = Ferrum::Browser::Command.build(Ferrum::Browser::Options.new, nil) -puts `'#{command.path}' --version` +puts `'#{Shellwords.escape(command.path)}' --version` puts "" Capybara.save_path = File.join(CUPRITE_ROOT, "spec", "tmp", "save_path")