Skip to content

Commit

Permalink
DEV: check for google-chrome-stable first
Browse files Browse the repository at this point in the history
on my distro google-chrome-stable is the only binary created when installing
chrome, this ensures we check for it first
  • Loading branch information
SamSaffron committed Mar 19, 2019
1 parent 64f20e7 commit 21c4754
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/autospec/qunit_runner.rb
Expand Up @@ -114,9 +114,13 @@ def stop
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
Expand Down

0 comments on commit 21c4754

Please sign in to comment.