Sha256: 3e24aec9a21c14163d8af2b8df1526b597ee3a02aa2faa28f644eb499bd3921e

Contents?: true

Size: 708 Bytes

Versions: 8

Compression:

Stored size: 708 Bytes

Contents

# frozen_string_literal: true

require "test_helper"

class HuaweiBrowserTest < Minitest::Test
  test "detects Huawei Browser" do
    browser = Browser.new(Browser["HUAWEI_BROWSER"])
    assert browser.huawei_browser?
    refute browser.safari?
    refute browser.chrome?
    assert_equal "Huawei Browser", browser.name
    assert_equal :huawei_browser, browser.id
  end

  test "detects correct version" do
    browser = Browser.new(Browser["HUAWEI_BROWSER"])
    assert_equal "10.1.2.300", browser.full_version
    assert_equal "10", browser.version
  end

  test "detects version by range" do
    browser = Browser.new(Browser["HUAWEI_BROWSER"])
    assert browser.huawei_browser?(%w[>=10 <11])
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
browser-6.2.0 test/unit/huawei_browser_test.rb
browser-6.1.0 test/unit/huawei_browser_test.rb
browser-6.0.0 test/unit/huawei_browser_test.rb
browser-5.3.1 test/unit/huawei_browser_test.rb
browser-5.3.0 test/unit/huawei_browser_test.rb
browser-5.2.0 test/unit/huawei_browser_test.rb
browser-5.1.0 test/unit/huawei_browser_test.rb
browser-5.0.0 test/unit/huawei_browser_test.rb