Sha256: 980c81d8ad056a3bc898a75fdde3187b7cbe520d5a63ccf9d7d1495999c572a8

Contents?: true

Size: 1.04 KB

Versions: 16

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

require "test_helper"

class YandexTest < Minitest::Test
  test "detects Yandex on iOS device" do
    browser = Browser.new(Browser["YANDEX_BROWSER_IOS"])
    assert browser.yandex?
    assert browser.yandex_browser?
    refute browser.safari?
    refute browser.chrome?
    assert browser.webkit?
    assert_equal "Yandex", browser.name
    assert_equal :yandex, browser.id
  end

  test "detects Yandex on non-iOS devices" do
    browser = Browser.new(Browser["YANDEX_BROWSER_DESKTOP"])
    assert browser.yandex?
    assert browser.yandex_browser?
    refute browser.safari?
    refute browser.chrome?
    assert_equal "Yandex", browser.name
    assert_equal :yandex, browser.id
  end

  test "detects correct version" do
    browser = Browser.new(Browser["YANDEX_BROWSER_DESKTOP"])
    assert_equal "19.6.0.1583", browser.full_version
    assert_equal "19", browser.version
  end

  test "detects version by range" do
    browser = Browser.new(Browser["YANDEX_BROWSER_DESKTOP"])
    assert browser.yandex?(%w[>=18 <20])
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
browser-6.1.0 test/unit/yandex_test.rb
browser-6.0.0 test/unit/yandex_test.rb
browser-5.3.1 test/unit/yandex_test.rb
browser-5.3.0 test/unit/yandex_test.rb
browser-5.2.0 test/unit/yandex_test.rb
browser-5.1.0 test/unit/yandex_test.rb
browser-5.0.0 test/unit/yandex_test.rb
browser-4.2.0 test/unit/yandex_test.rb
browser-4.1.0 test/unit/yandex_test.rb
browser-4.0.0 test/unit/yandex_test.rb
browser-3.0.3 test/unit/yandex_test.rb
browser-3.0.2 test/unit/yandex_test.rb
browser-3.0.1 test/unit/yandex_test.rb
browser-3.0.0 test/unit/yandex_test.rb
browser-2.7.1 test/unit/yandex_test.rb
browser-2.7.0 test/unit/yandex_test.rb