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
This commit is contained in:
Sam Saffron 2019-03-19 17:32:27 +11:00
parent 64f20e7e7a
commit 21c4754324

View File

@ -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