Sha256: 21b3742e19b2c387eecb8dfd27333d8ac1f5c871b0a826455f638a0f470a5e3d

Contents?: true

Size: 964 Bytes

Versions: 23

Compression:

Stored size: 964 Bytes

Contents

# frozen_string_literal: true

require "test_helper"

class WindowPhoneTest < Minitest::Test
  test "detects windows phone" do
    browser = Browser.new(Browser["WINDOWS_PHONE"])

    assert browser.ie?
    assert_equal "7", browser.version
    assert browser.platform.windows_phone?
    refute browser.platform.windows_mobile?
  end

  test "detects windows phone 8" do
    browser = Browser.new(Browser["WINDOWS_PHONE8"])

    assert browser.ie?
    assert_equal "10", browser.version
    assert browser.platform.windows_phone?
    refute browser.platform.windows_mobile?
  end

  test "detects windows phone 8.1" do
    browser = Browser.new(Browser["WINDOWS_PHONE_81"])

    assert browser.ie?
    assert_equal "Internet Explorer", browser.name
    assert_equal :ie, browser.id
    assert_equal "11", browser.version
    assert_equal "11.0", browser.full_version
    assert browser.platform.windows_phone?
    refute browser.platform.windows_mobile?
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
browser-2.5.1 test/unit/windows_phone_test.rb
browser-2.5.0 test/unit/windows_phone_test.rb
browser-2.4.0 test/unit/windows_phone_test.rb