From 21c4754324bb92766976d38b61ff9440e6c3d61e Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Tue, 19 Mar 2019 17:32:27 +1100 Subject: [PATCH] DEV: check for google-chrome-stable first on my distro google-chrome-stable is the only binary created when installing chrome, this ensures we check for it first --- lib/autospec/qunit_runner.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/autospec/qunit_runner.rb b/lib/autospec/qunit_runner.rb index 91e3d3983cb..7df2f5ac65f 100644 --- a/lib/autospec/qunit_runner.rb +++ b/lib/autospec/qunit_runner.rb @@ -114,9 +114,13 @@ module Autospec private def ensure_chrome_is_installed - raise ChromeNotInstalled.new unless system("command -v google-chrome >/dev/null;") - if Gem::Version.new(`$(command -v google-chrome) --version`.match(/[\d\.]+/)[0]) < Gem::Version.new("59") + binary = "google-chrome-stable" if system("command -v google-chrome-stable >/dev/null;") + binary ||= "google-chrome" if system("command -v google-chrome >/dev/null;") + + raise ChromeNotInstalled.new if !binary + + if Gem::Version.new(`#{binary} --version`.match(/[\d\.]+/)[0]) < Gem::Version.new("59") raise "Chrome 59 or higher is required" end end