File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
lib/ferrum/browser/options Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
33require "singleton"
4+ require "open3"
45
56module Ferrum
67 class Browser
@@ -12,6 +13,14 @@ def self.options
1213 instance
1314 end
1415
16+ # @return [String, nil]
17+ def self . version
18+ out , = Open3 . capture2 ( instance . detect_path , "--version" )
19+ out . strip
20+ rescue Errno ::ENOENT
21+ nil
22+ end
23+
1524 def to_h
1625 self . class ::DEFAULT_OPTIONS
1726 end
Original file line number Diff line number Diff line change 2525 expect ( defaults . merge_default ( { } , options ) ) . not_to include ( "use-angle" => "metal" )
2626 end
2727 end
28+
29+ describe ".version" do
30+ it "returns an executable version" do
31+ expect ( described_class . version ) . to match ( /(Chromium|Chrome) \d / )
32+ end
33+ end
2834end
You can’t perform that action at this time.
0 commit comments