From 63bbadb4502418376465809654b99492ca76eb38 Mon Sep 17 00:00:00 2001 From: Dmitry Galinsky Date: Mon, 2 Dec 2024 17:34:26 +0300 Subject: [PATCH] add specs --- lib/ferrum/browser/options/base.rb | 2 +- spec/browser/options/chrome_spec.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/ferrum/browser/options/base.rb b/lib/ferrum/browser/options/base.rb index 86161eff..d964d3fe 100644 --- a/lib/ferrum/browser/options/base.rb +++ b/lib/ferrum/browser/options/base.rb @@ -15,7 +15,7 @@ def self.options # @return [String, nil] def self.version - out, _ = Open3.capture2(detect_path, "--version") + out, = Open3.capture2(detect_path, "--version") out.strip rescue Errno::ENOENT nil diff --git a/spec/browser/options/chrome_spec.rb b/spec/browser/options/chrome_spec.rb index d02f730a..a937ba32 100644 --- a/spec/browser/options/chrome_spec.rb +++ b/spec/browser/options/chrome_spec.rb @@ -25,4 +25,10 @@ expect(defaults.merge_default({}, options)).not_to include("use-angle" => "metal") end end + + describe ".version" do + it "returns an executable version" do + expect(described_class.version).to match(/Chromium \d/) + end + end end