Sha256: 6d4a61eea02d10ddf52da2df68842c98b48697982014261f938b2270a607b580

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require "test_helper"

class FirefoxTest < Minitest::Test
  test "detects firefox" do
    @browser = Browser.new ua: $ua["FIREFOX"]

    assert_equal "Firefox", @browser.name
    assert @browser.firefox?
    refute @browser.modern?
    assert_equal "3.8", @browser.full_version
    assert_equal "3", @browser.version
  end

  test "detects modern firefox" do
    @browser = Browser.new ua: $ua["FIREFOX_MODERN"]

    assert_equal :firefox, @browser.id
    assert_equal "Firefox", @browser.name
    assert @browser.firefox?
    assert @browser.modern?
    assert_equal "17.0", @browser.full_version
    assert_equal "17", @browser.version
  end

  test "detects firefox android tablet" do
    @browser = Browser.new ua: $ua["FIREFOX_TABLET"]

    assert_equal :firefox, @browser.id
    assert_equal "Firefox", @browser.name
    assert @browser.firefox?
    assert @browser.modern?
    assert @browser.tablet?
    assert @browser.android?
    assert_equal "14.0", @browser.full_version
    assert_equal "14", @browser.version
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
browser2-1.0.0 test/unit/firefox_test.rb